How to enable query log in Laravel?

2019-11-18 04:20:50 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