-
app/Observers/Users/AuthorObserver.php
Open in GitHubuse App\Models\Users\Author; class AuthorObserver { public function saving(Author $author) { $author->slugifyName(); } }
-
app/Providers/ObserverServiceProvider.php
Open in GitHubclass ObserverServiceProvider extends ServiceProvider { public function boot() { // Author::observe('App\Observers\Users\AuthorObserver'); } }
-
config/app.php
Open in GitHubreturn [ // 'providers' => [ // App\Providers\ObserverServiceProvider::class, // ], // ];