Created
May 2, 2021 04:28
-
-
Save elsodev/74bcc52892aeedd97250366655b9576a to your computer and use it in GitHub Desktop.
Nova use a Model Observer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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