Customizing the notifiable | laravel-backup | Spatie

 SPATIE

  Laravel Backup
=================

spatie.be/open-source

  [Docs](https://spatie.be/docs)  [Laravel-backup](https://spatie.be/docs/laravel-backup/v4)  Sending-notifications  Customizing the notifiable

 Version   v10   v9   v8   v7   v6   v5   v4   v3

 Other versions for crawler [v10](https://spatie.be/docs/laravel-backup/v10) [v9](https://spatie.be/docs/laravel-backup/v9) [v8](https://spatie.be/docs/laravel-backup/v8) [v7](https://spatie.be/docs/laravel-backup/v7) [v6](https://spatie.be/docs/laravel-backup/v6) [v5](https://spatie.be/docs/laravel-backup/v5) [v4](https://spatie.be/docs/laravel-backup/v4) [v3](https://spatie.be/docs/laravel-backup/v3)

  Customizing the notifiable
- [ Introduction ](https://spatie.be/docs/laravel-backup/v4/introduction)
- [ Postcardware ](https://spatie.be/docs/laravel-backup/v4/postcardware)
- [ Requirements ](https://spatie.be/docs/laravel-backup/v4/requirements)
- [ High level overview ](https://spatie.be/docs/laravel-backup/v4/high-level-overview)
- [ Installation and setup ](https://spatie.be/docs/laravel-backup/v4/installation-and-setup)
- [ Questions &amp; issues ](https://spatie.be/docs/laravel-backup/v4/questions-and-issues)
- [ Changelog ](https://spatie.be/docs/laravel-backup/v4/changelog)
- [ About us ](https://spatie.be/docs/laravel-backup/v4/about-us)

Taking Backups
--------------

- [ Taking backups ](https://spatie.be/docs/laravel-backup/v4/taking-backups/overview)
- [ Events ](https://spatie.be/docs/laravel-backup/v4/taking-backups/events)

Cleaning up old backups
-----------------------

- [ Cleaning up old backups ](https://spatie.be/docs/laravel-backup/v4/cleaning-up-old-backups/overview)
- [ Events ](https://spatie.be/docs/laravel-backup/v4/cleaning-up-old-backups/events)

Monitoring the health of all backups
------------------------------------

- [ Events ](https://spatie.be/docs/laravel-backup/v4/monitoring-the-health-of-all-backups/events)
- [ Monitoring the health of all backups ](https://spatie.be/docs/laravel-backup/v4/monitoring-the-health-of-all-backups/overview)

Sending notifications
---------------------

- [ Sending notifications ](https://spatie.be/docs/laravel-backup/v4/sending-notifications/overview)
- [ Adding extra notification channels ](https://spatie.be/docs/laravel-backup/v4/sending-notifications/adding-extra-notification-channels)
- [ Customizing the notifiable ](https://spatie.be/docs/laravel-backup/v4/sending-notifications/customizing-the-notifiable)

Advanced Usage
--------------

- [ Adding extra files to a backup ](https://spatie.be/docs/laravel-backup/v4/advanced-usage/adding-extra-files-to-a-backup)
- [ Backing up a non-laravel application ](https://spatie.be/docs/laravel-backup/v4/advanced-usage/backing-up-a-non-laravel-application)

      You are viewing the documentation for **an older version** of this package. You can check the version you are using with the following command:

 `                                    composer show spatie/laravel-backup                                                                                                                                                                                                                                    `

Customizing the notifiable
==========================

Laravel 5.3's notifications are sent to a notifiable. A notifiable provides configuration values that determine how notifications will be sent.

By default the package uses this notifiable class: `\Spatie\Backup\Notifications\Notifiable`. This class will read out the config file. All mail notifications will be sent to the mail address specified in the `notifications.mail.to` key of the config file.

If you use a channel that needs some get some extra information out of the notifiable you can easily extend the default notifiable.

Here's how that might look like:

```
namespace App\Notifications;

use Spatie\Backup\Notifications\Notifiable;

class BackupNotifiable extends Notifiable
{
    public function routeNotificationForAnotherNotificationChannel()
    {
        return config('laravel-backup.notifications.another_notification_channel.property');
    }
}

```

Don't forget to register the notifiable in the config file:

```
// config/laravel-backup
    'notifications' => [
    ...

        'notifiable' => App\Notifications\BackupNotifiable::class,
```

 A good
match?
-------------

### What we do best

- All things Laravel
- Custom frontend components
- Building APIs
- AI-powered features
- Simplifying things
- Clean solutions
- Integrating services

### Not our cup of tea

- WordPress themes
- Cutting corners
- Free mockups to win a job
- "Just execute the briefing"

 In short: we'd like to be a **substantial part** of your project.

 [ Get in touch via email ](mailto:info@spatie.be?subject=A%20good%20match%21&body=Tell%20us%20as%20much%20as%20you%20can%20about%0A-%20your%20online%20project%0A-%20your%20planning%0A-%20your%20budget%0A-%20%E2%80%A6%0A%0AAnything%20that%20helps%20us%20to%20start%20straightforward%21)
