Skip to content

Instantly share code, notes, and snippets.

@ajtrichards
Last active July 7, 2022 23:50
Show Gist options
  • Save ajtrichards/69c9b32d2c42484803bc to your computer and use it in GitHub Desktop.
Save ajtrichards/69c9b32d2c42484803bc to your computer and use it in GitHub Desktop.
Laravel Lumen - Display Query Log
/**
* You must enable to Query Log when using Lumen.
*/
DB::connection()->enableQueryLog();
$queries = DB::getQueryLog();
$last_query = end($queries);
@ssi-anik
Copy link

app('db')->connection()->enableQueryLog()
Facade is not enabled by default.

@ajtrichards
Copy link
Author

Yeah your right - I have enabled on mine and I always tend to do so :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment