Answer the question
In order to leave comments, you need to log in
Laravel migration events don't fire?
Laravel Migration event listeners doesn't work.
config/app.php
'providers' => [
...
App\Providers\EventServiceProvider::class,
....
namespace App\Providers;
use App\Listeners\DeleteUnitsImagesFromAws;
use Illuminate\Database\Events\MigrationsStarted;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Event;
class EventServiceProvider extends ServiceProvider
{
protected $listen = [
MigrationsStarted::class => [
DeleteUnitsImagesFromAws::class,
]
];
public function boot()
{
parent::boot();
Event::listen(MigrationsStarted::class, function($event) {
\Log::channel('payment')->info(['class' => 'DeleteUnitsImagesFromAws']);
});
}
}
namespace Illuminate\Database\Events;
use Illuminate\Contracts\Database\Events\MigrationEvent as MigrationEventContract;
class MigrationsStarted implements MigrationEventContract
{
public function __construct()
{
\Log::channel('daily')->info(['class' => '1000']);
}
}
Answer the question
In order to leave comments, you need to log in
Solved , see here
https://stackoverflow.com/questions/61749800/liste...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question