Laravel Enable Query Log

[Solved] Laravel Enable Query Log | Php - Code Explorer | yomemimo.com
Question : How to Log Query in Laravel

Answered by : indian-gooner

DB::enableQueryLog();
$arr_user = DB::table('users')->select('name', 'email as user_email')->get();
dd(DB::getQueryLog());

Source : https://artisansweb.net/how-to-log-query-in-laravel/ | Last Update : Wed, 06 May 20

Question : How to Log Query in Laravel

Answered by : amit-rajput

DB::enableQueryLog();
$user = DB::table('users')->select('name', 'email as user_email')->get();
dd(DB::getQueryLog());

Source : | Last Update : Thu, 14 Jan 21

Question : laravel enable query log

Answered by : dfg

use Illuminate\Support\Facades\DB;
...
...
 
public function UserController()
{
    DB::enableQueryLog();
    $arr_user = DB::table('users')->select('name', 'email as user_email')->get();
    dd(DB::getQueryLog());
}

Source : https://artisansweb.net/how-to-log-query-in-laravel/ | Last Update : Wed, 27 Jul 22

Question : query log laravel

Answered by : kriss-sachintha

import DB with this line first,
use Illuminate\Support\Facades\DB;

Source : | Last Update : Wed, 14 Sep 22

Question : laravel enable query log

Answered by : dfg

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

Source : https://stackoverflow.com/questions/41140975/laravel-eloquent-display-query-log | Last Update : Wed, 27 Jul 22

Question : query log laravel

Answered by : kriss-sachintha

check whethe the serviceprovider is added in the providers array in config/app.php if no then check whether the service provider class is the correct location and include the serivce provider in the providers array in config.app.php 

Source : https://stackoverflow.com/questions/40695978/how-to-fix-service-provider-class-not-found-when-using-repository | Last Update : Wed, 14 Sep 22

Answers related to laravel enable query log

Code Explorer Popular Question For Php