I'd like to check the SQL for performing an update in flll→save in Eloquent ORM.
Unable to verify execution SQL.I can actually update it, and in case of find, I can check the execution SQL as expected.
Is there any way?
$news=News::find($request->id);
$news_form = $request->all();
\DB::enableQueryLog();
$news->fill($news_form)->save();
dd(\DB::getQueryLog());
When I changed the value of the fill part, it was updated and the running SQL was also displayed.
If I don't change anything, it won't be updated.
© 2024 OneMinuteCode. All rights reserved.