Laravel: Listening for Query Events cover image

Laravel: Listening for Query Events

Sam Ciaramilaro • April 27, 2017

Snippets
// Inside a service provider
public function boot()
{
    DB::listen(function ($query) {
        // $query->sql;
        // $query->bindings;
        // $query->time;
    });
}