How to enable query log in Laravel?

2019-12-09 23:50:16 Sanjay Laravel

Enable query log Laravel

Use the enableQueryLog method: Use the enableQueryLog method:

DB::connection()->enableQueryLog();

You can get an array of the executed queries by using the getQueryLog method:

$queries = DB::getQueryLog();


This post is submitted by one of our members. You may submit a new post here.

Related Tricks