outl1ne / nova-settings

A Laravel Nova tool for editing custom settings using native Nova fields.
MIT License
273 stars 97 forks source link

Is there a event on update? #63

Closed JshGrn closed 3 years ago

JshGrn commented 3 years ago

I have searched the docs and doesn't look like there is, is there anywhere I can hook so that when the setting is updated I can do something? For context I am updating a theme colour and I have a function which will use the setting and write to a theme.css file, I want to regenerate this file when the setting has updated (not even just changed as that will do)

Tarpsvo commented 3 years ago

You can create an observer for the Settings model and then see what key and value pair was updated.

See: https://laravel.com/docs/8.x/eloquent#observers