This article brings you a Laravel SQL statement (recommended). Share to everybody, make a reference for everybody. We hope to help you.
Print the SQL statement directly after you execute the SQL statement output
Method One:
$queries = Db::getquerylog ();
$a = end ($queries);
$tmp = Str_replace ('? ', ' "'. ') %s '. ' ', $a ["query"]);
Echo vsprintf ($tmp, $a [' bindings ']);
Exit
Method Two: Focus on the routes.php
Event::listen (' Illuminate.query ', function ($query) {var_dump ($query);});
Above this laravel SQL statement (recommended) is the small part of the whole content to share to everyone, I hope to give you a reference, but also hope that we support the script home.
Related recommendations:
Laravel Redis multiple processes simultaneously fetching queue issues
Elegant way to generate Gravatar avatar address using Laravel
Laravel reasons for repeating the same queue task