When I usually update a record, I do
$myObject->update(['field' => 'value']);
And that updates both the database and my instance $myObject. However, sometimes, I need to do bulk updates, so I use the model facade and do
$result = MyObject::where(...)->update(['field' => 'value');
The issue here is that $result sends me back a boolean instead of the updated instances so what I usually have to do separately is right after I need to do the same filter, but this time a get().
$objects = MyObject::where(...)->get();
Is there a more efficient way to update and get the records in one call/request to the database?