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 query log with bind array and all - How can I get the pure SQL, so I can run it in PhpMyAdmin
SET GLOBAL general_log = 1in the database, run the query, turn logging back off (set to 0), then check the general log to see the exact query that was run.