draganus / laravel-notification-preferences
Users can: Enable/disable notifications for email address, push notifications, SMS, slack..
Fund package maintenance!
draganus
Requires
- php: ^8.0
- illuminate/contracts: ^8.37
- spatie/laravel-package-tools: ^1.4.3
Requires (Dev)
- nunomaduro/collision: ^5.3
- orchestra/testbench: ^6.15
- pestphp/pest: ^1.18
- pestphp/pest-plugin-laravel: ^1.1
- spatie/laravel-ray: ^1.23
- vimeo/psalm: ^4.8
README
Support me
Installation
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'] ];
Usage
in your Notification class replace via method
public function via($notifiable) { $notificationPreference = new NotificationPreference(); return $notificationPreference->check($notifiable, self::class); }
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.