Giter VIP home page Giter VIP logo

notification-module's Introduction

Notification module

Latest Version Software License Build Status Quality Score SensioLabs Insight

Total Downloads Total Downloads Total Downloads Slack

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

$this->notification->push('New subscription', 'Someone has subscribed!', 'fa fa-hand-peace-o text-green', route('admin.user.user.index'));
/**
* 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);

Notifications demo screenshot Quick demo


Installation

Module Download

Using EncoreCMS's module download command:

php artisan asgard:download:module tecnodesignc/notification --migrations

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:

composer require tecnodesignc/notification-module

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

Run migrations

php artisan module:migrate notification

Publish the configuration

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.

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.

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

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.

Usage

Usage is simple and straightforward:

Inject the Modules\Notification\Services\Notification interface where you need it and assign it to a class variable.

Send notification to logged in user

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

Send notification to a specific user

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

notification-module's People

Contributors

marcos21009 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.