Skip to content

Instantly share code, notes, and snippets.

@elsodev
Created May 2, 2021 04:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elsodev/74bcc52892aeedd97250366655b9576a to your computer and use it in GitHub Desktop.
Save elsodev/74bcc52892aeedd97250366655b9576a to your computer and use it in GitHub Desktop.
Nova use a Model Observer
class NovaServiceProvider extends NovaApplicationServiceProvider
{
public function boot()
{
parent::boot();
// registers observers for eloquent model events(only for Nova)
Nova::serving(function () {
\App\User::observe(UserObserver::class);
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment