Laravel: Listening for Query Events

Published in Laravel, Code on Apr 27, 2017
// Inside a service provider
public function boot()
{
    DB::listen(function ($query) {
        // $query->sql;
        // $query->bindings;
        // $query->time;
    });
}