brkfun / notification-options
Make a sense to notification options
v0.5
2023-06-17 23:32 UTC
Requires
- php: ^7.1|^8.0|^8.1
- illuminate/support: ^5.5|^6.0|^7.0|^8.0
Requires (Dev)
- orchestra/testbench: 3.8.*
- phpunit/phpunit: ^7.0
README
Installation
You can install the package via composer:
composer require brkfun/notification-options
You can also drop the config and needed files :
php artisan vendor:publish --provider="BRKFun\\NotificationOptions\\NotificationOptionsServiceProvider"
Usage
Go to your notifiable model and add a trait
namespace App\Models; use Illuminate\Foundation\Auth\User as Authenticatable; use BRKFun\NotificationOptions\Traits\HasNotificationOptions; class User extends Authenticatable { use HasNotificationOptions; }
Whenever you call anything starts with wants ie.
$user = User::first(); return $user->wantsMailNotification;
it will turn you the setting for user. If there isn't any settings in for user, it will create a new setting value to database
Todo List
1. create a router and methods for subscribe and unsubscribe stuff.
2. create facade for faster usage.
Testing
No testing developed yet.
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues just drop an issue.
Credits
License
The The Unlicense. Please see License File for more information.
Laravel Package Boilerplate
This package was generated using the Laravel Package Boilerplate.