How to enable query log in Laravel?

2024-04-18 21:25:35 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