I want to check the SQL execution when updating with Ravel 5.8 fill→save

Asked 2 years ago, Updated 2 years ago, 254 views

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());

Enter a description of the image here

laravel

2022-09-30 21:49

1 Answers

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.


2022-09-30 21:49

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.