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"
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
No testing developed yet.
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues just drop an issue.
The The Unlicense. Please see License File for more information.
This package was generated using the Laravel Package Boilerplate.