I'm developing an application with Laravel 5.1 and I try to get information from json but i can't, i have the next code:
Routes:
Route::get('toys','ToyController@listing');
Controller:
public function listing(){
$toys = Toy::all();
return response()->json([
"toys" => $toys->toArray()
]);
}
Petition get:
<script>
$(document).ready(function(){
$.getJSON("http://localhost:8000/toys", function(data){
});
});
</script>
And i can see the data into the console:
but how can show the info into HTML? thanks