My EventServiceProvider.php:
protected $listen = [
'eloquent.deleted: *' => [
'App\Listeners\EloquentListener',
],
'eloquent.deleting: *' => [
'App\Listeners\EloquentListener',
]
];
But its not working.
when I do it this way on my model file Its still not working:
public function boot()
{
parent::boot();
Event::listen(['eloquent.deleting: *'], function ($foo, $bar) {
echo $foo;
});
}
My laravel version is: 7.15
What is the problem? Do you have any idea?