Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Viatori's avatar

updated event is not called

Hi,

I'm using laravel nova. I added model observer. Like that when resource is created, updated etc... observer can call other methods.

created event and deleted event are called great.

but updated event is not called. Do you know why ?

here : https://nova.laravel.com/docs/3.0/resources/#resource-events it's saying that nova call save, delete, forceDelete and restore event. So i'm confused about update event. Is "Save" event is called just for creation or for creation and update event ?

Thanks for your reply,

Thibaut

0 likes
6 replies
boka18's avatar

You need to register the Observer in AppServiceProvider. like this

public function boot()
    {
        User::observe(UserObserver::class);
    }
Viatori's avatar

Thanks for your reply. I done it. And created event and deleted event are greatly called.

But not updated... :(

boka18's avatar

Oh. I think I've encountered this before. If you are trying to update the model with the same data, the updated function won't get triggered.

For example, you have a row in DB with first_name = Test, and you try to update it with first_name = Test, it won't get triggered.

Try updating the model with different data. It should work.

1 like
Viatori's avatar

ok, thanks, i will test it tomorrow.

bait-dept's avatar

Hi @viatori

I don't know much about Nova, but Laravel won't trigger the observer when doing mass updates.

"When issuing a mass update via Eloquent, the saving, saved, updating, and updated model events will not be fired for the updated models. This is because the models are never actually retrieved when issuing a mass update." - https://laravel.com/docs/8.x/eloquent#mass-updates

Could it be related ?

1 like

Please or to participate in this conversation.