Enable Sql Log in Laravel

07-08-2017

Add following codes to routes.php file

Event::listen('Illuminate\Database\Events\QueryExecuted', function ($query) {
    if (App::environment() == 'local') {
        Log::info($query->sql . ' Parameters: ' . serialize($query->bindings));
    }
});

© 2019 All rights reserved. Codesenior.COM