Im trying to figure out how to get the raw sql query being executed including the binded data in it. Here is what ive got:
\\DB::connection()->enableQueryLog(
Add this in your routes Folder :
\Event::listen('Illuminate\Database\Events\QueryExecuted', function ($query) {
Log::info( json_encode($query->sql) );
Log::info( json_encode($query->bindings) );
Log::info( json_encode($query->time) );
});
Log::info() ==> will log the SQL query in your storage/logs/laravel.log file
var_dump() ==> will display in the API call output