Created
March 13, 2020 15:34
-
-
Save mwleinad/9a748fb8c93f8bc17fd9adff57624c9b to your computer and use it in GitHub Desktop.
Log last executed query in laravel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
\DB::connection()->enableQueryLog(); | |
//Eloquent or db query. | |
$query = \DB::getQueryLog(); | |
$lastQuery = end($query); | |
\Log::info($lastQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment