generated from spatie/package-skeleton-laravel
-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
It seems while using this mass-update, the model's lifecycle hooks are not executed.
E.g. while mass updating a sortIndex
property in Attachments:
// From Attachments model
use MassUpdatable;
protected static function boot(): void {
parent::boot();
static::saved(function ($attachment) {
$attachment->email->hasSortedAttachments = 1;
$attachment->email->save();
});
}
If the saving hook was executed during mass update, the relation email
should have hasSortedAttachments = 1, but it remains 0.
This wouldn't be an issue, if the mass update was done using the \DB QueryBuilder, but since it was done using a Model function, it should be honored.
Metadata
Metadata
Assignees
Labels
No labels