Its not a bug ... you are not updating a model
there. That is an update statement being applied via a direct query. That is Eloquent\Builder@update
not Model@update
. That could be updating many records.
If you want to update a model directly, get the model then call update
on it.
Thank you for your response lagbox! I understand what you are saying, but I invoked the update statement via Foo, so I feel like the model events should fire. If I invoked via db::update, I would understand why they wouldn't be. I want the efficiency of the batch update with the features of the model update.
It does not know what 'records' it is updating as its a DB update statement. It would have to do a select based on the query, then get all the ids then do the update.
You could simulate this potentially with your own method.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community