When running php artisan backup:run --disable-notifications, the BackupWasSuccessful event does not fire, preventing listeners from executing. Without the flag, the event fires correctly.
Steps to Reproduce
Set up an event listener for Spatie\Backup\Events\BackupWasSuccessful in EventServiceProvider.
Run php artisan backup:run --disable-notifications.
Observe that the listener does not execute.
Expected behavior
The BackupWasSuccessful event should fire regardless of the --disable-notifications flag.
Environment
Laravel Version: 10.0
Spatie Laravel Backup Version: 8.8
Additional context
Here is the relevant setup in EventServiceProvider:
protected $listen = [
Spatie\Backup\Events\BackupWasSuccessful::class => [
App\Listeners\BackupCompletedListener::class,
],
];
public function boot()
{
parent::boot();
Event::listen(Spatie\Backup\Events\BackupWasSuccessful::class, function ($event) {
Log::info('BackupWasSuccessful event fired.');
});
}
This bug occurs when I want to call backup in code like this:
Describe the bug
When running
php artisan backup:run --disable-notifications
, theBackupWasSuccessful
event does not fire, preventing listeners from executing. Without the flag, the event fires correctly.Steps to Reproduce
Spatie\Backup\Events\BackupWasSuccessful
inEventServiceProvider
.php artisan backup:run --disable-notifications
.Expected behavior
The
BackupWasSuccessful
event should fire regardless of the--disable-notifications
flag.Environment
Additional context
Here is the relevant setup in
EventServiceProvider
:This bug occurs when I want to call backup in code like this:
Thanks To Spatie Team