laravel 8 events code example
Example 1: laravel event listener
php artisan event:generate
Example 2: laravel creating event get data
// Only available for the '-ing' events, not '-ed',
// e.g. only for 'creating', not 'created'
User::updating(function ($user) {
$dirty = $user->getDirty();
$original = $user->getOriginal();
});