How to Get the Query Executed in Laravel 5? DB::getQueryLog() Returning Empty Array

I’m trying to view the log for a query, but DB::getQueryLog() is just returning an empty array:

$user = User::find(5);
print_r(DB::getQueryLog());

Result

Array
(
)

How can I view the log for this query?

15 Answers
15

Leave a Comment