jeudi 28 février 2019

Laravel print last executed sql query with Query log

DB::enableQueryLog();
$mines = Cranks::where([['crank_id', '=', $this->crank_id], ['mine_id', 'like', '%'.$script_value->mine_id.'%'] ])->get();
$querylog =  DB::getQueryLog();
dd($querylog);

exit;

This code prints the querylog with bind array and all - How can I get the pure sql, so I can run it in PhpMyAdmin



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire