You can install the package via composer:
composer require draganus/laravel-notification-preferences
You can publish and run the migrations with:
php artisan vendor:publish --provider="draganus\LaravelNotificationPreferences\LaravelNotificationPreferencesServiceProvider"
php artisan migrate
This is the contents of the published config file:
return [
/*
* Set the defoult notification's delivery channels
*/
"notify_channels" => ['mail', 'database']
];
in your Notification class replace via method
public function via($notifiable)
{
$notificationPreference = new NotificationPreference();
return $notificationPreference->check($notifiable, self::class);
}
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.