draganus/laravel-notification-preferences

Users can: Enable/disable notifications for email address, push notifications, SMS, slack..

0.0.1 2021-12-02 12:31 UTC

This package is auto-updated.

Last update: 2024-11-11 04:29:21 UTC


README

Latest Version on Packagist GitHub Code Style Action Status Total Downloads

Support me

You can bye me a coffee ☕️.

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.