2017 © Pedro Peláez
 

asgard-module notification-module

Module handling the real time notifications

image

asgardcms/notification-module

Module handling the real time notifications

  • Monday, January 15, 2018
  • by nWidart
  • Repository
  • 6 Watchers
  • 15 Stars
  • 3,285 Installations
  • PHP
  • 0 Dependents
  • 7 Suggesters
  • 15 Forks
  • 3 Open issues
  • 11 Versions
  • 3 % Grown

The README.md

Notification module

Latest Version Software License Build Status Quality Score SensioLabs Insight, (*1)

Total Downloads Total Downloads Total Downloads Slack, (*2)

Quickly send (real-time) notifications to your AsgardCms application., (*3)

php $this->notification->push('New subscription', 'Someone has subscribed!', 'fa fa-hand-peace-o text-green', route('admin.user.user.index'));, (*4)

php /** * Push a notification on the dashboard * @param string $title * @param string $message * @param string $icon * @param string|null $link */ public function push($title, $message, $icon, $link = null);, (*5)

Notifications demo screenshot Quick demo, (*6)


Installation

Module Download

Using AsgardCMS's module download command:, (*7)

``` bash php artisan asgard:download:module asgardcms/notification --migrations, (*8)


This will download the module and run its migrations . This is the recommended way if you wish to customise the fields, views, etc. ### Composer Execute the following command in your terminal: ``` bash composer require asgardcms/notification-module

Note: After installation you'll have to give you the required permissions to get to the blog module pages in the backend., (*9)

Run migrations

``` bash php artisan module:migrate notification, (*10)


### Publish the configuration ``` bash php artisan module:publish-config notification

Real time?

If you want real time notifications over websockets, you need to configure the broadcasting.php config file. After that is done, set the asgard.notification.config.real-time option to true., (*11)

Currently, Laravel broadcasting supports Pusher and Redis, but AsgardCms only has the front-end integration for Pusher. More integrations are welcome via pull-request. Look at the Pusher integration for inspiration., (*12)

For configuring Pusher, you can add the following lines to your .env file:, (*13)

PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_ID=
PUSHER_APP_CLUSTER=us2
PUSHER_APP_ENCRYPTED=true

Your app's "Getting Started" tab on Pusher's website has a section for .env. You can just copy and paste those directly., (*14)

Usage

Usage is simple and straightforward:, (*15)

Inject the Modules\Notification\Services\Notification interface where you need it and assign it to a class variable., (*16)

Send notification to logged in user

``` php $this->notification->push('New subscription', 'Someone has subscribed!', 'fa fa-hand-peace-o text-green', route('admin.user.user.index'));, (*17)


### Send notification to a specific user ``` php $this->notification->to($userId)->push('New subscription', 'Someone has subscribed!', 'fa fa-hand-peace-o text-green', route('admin.user.user.index'));

The Versions

15/01 2018

2.0.x-dev

2.0.9999999.9999999-dev

Module handling the real time notifications

  Sources   Download

MIT

The Requires

 

The Development Requires

notifications pusher asgardcms

15/01 2018

2.1.0

2.1.0.0

Module handling the real time notifications

  Sources   Download

MIT

The Requires

 

The Development Requires

notifications pusher asgardcms

11/10 2017

dev-master

9999999-dev

Module handling the real time notifications

  Sources   Download

MIT

The Requires

 

The Development Requires

notifications pusher asgardcms

11/10 2017

3.0.1

3.0.1.0

Module handling the real time notifications

  Sources   Download

MIT

The Requires

 

The Development Requires

notifications pusher asgardcms

05/10 2017

3.0.0

3.0.0.0

Module handling the real time notifications

  Sources   Download

MIT

The Requires

 

The Development Requires

notifications pusher asgardcms

18/10 2016

2.0.0

2.0.0.0

Module handling the real time notifications

  Sources   Download

MIT

The Requires

 

The Development Requires

notifications pusher asgardcms

08/06 2016

1.4.0

1.4.0.0

Module handling the real time notifications

  Sources   Download

MIT

The Requires

 

The Development Requires

notifications pusher asgardcms

18/12 2015

1.3.0

1.3.0.0

Module handling the real time notifications

  Sources   Download

MIT

The Requires

 

The Development Requires

notifications pusher asgardcms

27/11 2015

1.2.0

1.2.0.0

Module handling the real time notifications

  Sources   Download

MIT

The Requires

 

The Development Requires

notifications pusher asgardcms

19/11 2015

1.1.0

1.1.0.0

Module handling the real time notifications

  Sources   Download

MIT

The Requires

 

The Development Requires

notifications pusher asgardcms

18/11 2015

1.0.0

1.0.0.0

Module handling the real time notifications

  Sources   Download

MIT

The Requires

 

The Development Requires

notifications pusher asgardcms