Skip to content

brkfun/notification-options

Repository files navigation

Laravel Notification Settings Package

Latest Version on Packagist Build Status Quality Score Total Downloads

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.