laravel spatie backup stop notification

40 Views Asked by At

how to turn off notification in spatie backup.

i create a command to run backup on daily bases but i want to stop notifications on success and failure i commented the notifications in backup config file :

'notifications' => [

        'notifications' => [
            // \Spatie\Backup\Notifications\Notifications\BackupHasFailedNotification::class => ['mail'],
            // \Spatie\Backup\Notifications\Notifications\UnhealthyBackupWasFoundNotification::class => ['mail'],
            // \Spatie\Backup\Notifications\Notifications\CleanupHasFailedNotification::class => ['mail'],
            // \Spatie\Backup\Notifications\Notifications\BackupWasSuccessfulNotification::class => ['mail'],
            // \Spatie\Backup\Notifications\Notifications\HealthyBackupWasFoundNotification::class => ['mail'],
            // \Spatie\Backup\Notifications\Notifications\CleanupWasSuccessfulNotification::class => ['mail'],
        ],

        /*
         * Here you can specify the notifiable to which the notifications should be sent. The default
         * notifiable will use the variables specified in this config file.
         */
        'notifiable' => '', //\Spatie\Backup\Notifications\Notifiable::class,

        'mail' => [
            'to' => '[email protected]',

            'from' => [
                'address' => env('MAIL_FROM_ADDRESS', '[email protected]'),
                'name' => env('MAIL_FROM_NAME', 'Example'),
            ],
        ],

        'slack' => [
            'webhook_url' => '',

            /*
             * If this is set to null the default channel of the webhook will be used.
             */
            'channel' => null,

            'username' => null,

            'icon' => null,

        ],

        'discord' => [
            'webhook_url' => '',

            /*
             * If this is an empty string, the name field on the webhook will be used.
             */
            'username' => '',

            /*
             * If this is an empty string, the avatar on the webhook will be used.
             */
            'avatar_url' => '',
        ],
    ],

even i commented all the block but when i run php artisan backup:run it backup successfully but keep try to send notification. I found a solution which is php artisan backup:run --disable-notifications but i am using backup in schedule and i couldn't add parameters in $schedule->command('backup:run')->daily(); i tried $schedule->command('backup:run --disable-notifications')->daily(); and i try it in signature protected $signature = 'db:backup --only-db --disable-notifications'; but both didn't work

0

There are 0 best solutions below