Feb 22, 2017

Laravel5 - How to log sql query?

Simple way, try to add code below on you route.

\Event::listen('Illuminate\Database\Events\QueryExecuted', function ($query) {
    \Log::debug($query->sql);
    //var_dump($query->bindings);
    //var_dump($query->time);
});


Working on 5.3
Post a Comment