enablequerylog laravel

PHP
\DB::enableQueryLog();

dd(\DB::getQueryLog());DB::enableQueryLog();

dd(DB::getQueryLog());
Source

Also in PHP: