Created
November 15, 2023 13:12
-
-
Save lucianobragaweb/1311d2a5143e87c210416fd8db1a9de4 to your computer and use it in GitHub Desktop.
Laravel Observers
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
php artisan make:observer NomeDoObserver |
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 Post extends Model { | |
protected static function boot() { | |
parent::boot(); | |
self::observe(NomeDoObserver::class); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment