mardi 5 septembre 2017

get query of illuminate.query in laravel 5.4

i have this route in my web.php:

Route::get('task' , function(){
   return App\Carsoul::all();
});

this code return:

[{"id":12,"image":"1502286679.jpg"},{"id":14,"image":"1502287112.jpg"}]  

i want to get query that return above result so i add this code before Route:

Event::listen('illuminate.query', function($query){
  var_dump($query);
});  

expect to return like:SELECT* FROM 'carsouls' ...
but return same result:

[{"id":12,"image":"1502286679.jpg"},{"id":14,"image":"1502287112.jpg"}] 

what is the mistake?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire