I have a code:
$update= DB::table('Appraiser_commands')->where('cycle_id', $cycleid)->where('user_id',$userId)->update(['mode' => $mode,'Appraiser_commnd'=>$json])->toSql();
echo $update;exit;
I am trying to convert laravel query to mysql using toSql()
But i got an error like
Call to a member function toSql() on integer
Then i tried
DB::table('Appraiser_commands')->where('cycle_id', $cycleid)->where('user_id',$userId)->update(['mode' => $mode,'Appraiser_commnd'=>$json])
DB::enableQueryLog();
$queries = DB::getQueryLog();
dd(end($queries));
But it returns output as 'false' i dint get the expected output.I don't know why this happened.Any help would be appreciated.
Expcted output:
UPDATE table_name
SET Appraiser_commnd=value, mode=value2,...
WHERE cycle_id=some_value