padosoft/laravel-notification

Notification system for laravel

1.1.0 2018-10-17 13:17 UTC

README

License

System for managing Laravel Notifications via database.

Installation

  1. add to your composer json in the repository section like this

     "repositories": [
     {
         "type": "git",
         "url": "https://gitlab.com/padosoftcms/laravel-notification"
     }
    

    ]

  2. composer require padosoft/laravel-notification

  3. Publish the config file by running php artisan vendor:publish --provider="Padosoft\Laravel\Notification\NotificationServiceProvider" --tag="migrations".

Installation - Laravel < 5.5

  1. Add Padosoft\Laravel\Notification\NotificationServiceProvider to the array of providers in config/app.php.
  2. Add 'NotificationManager' => 'Padosoft\Laravel\Notification\NotificationFacade' to the array of aliases in config/app.php.

##Config If you want you can publish also the config of the package Publish the config file by running php artisan vendor:publish --provider="Padosoft\Laravel\Notification\NotificationServiceProvider" --tag="config".

Usage

You can generate a Notification Class with an artisan command and register it into database.

php artisan notification-manager:create user_is_registered

This command will create a App\Notifications\user_is_registered class. Now you can customize your notification. To enable the notifications you can put to 1 the active field on the database. To set the recipients of your notification you have to populate mynotifications_users and mynotifications_roles table. The you can send your notification like this:

NotificationManager::dispatch(new \App\Notifications\user_is_registered('prova messaggio','prova'))

Contact

Open an issue on GitHub if you have any problems or suggestions.

License

The contents of this repository is released under the MIT license.