Download the PHP package matviib/notifier without Composer

On this page you can find all versions of the php package matviib/notifier. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package notifier

build passed code-intelligence license downloads

Base concepts

You don't need socket.io, pusher.js, jQuery, bootstrap, node.js, vue.js to start using this package.

This package can be used for sending data synchronously to each user.

This package sends data ONLY to named routes declared as GET.

You will get your own socket server on back-end and your clients will connect to it directly, without any third-party requests to be send.

You will have pretty notifications from scratch.

To view available routes you can run php artisan notifier:init show command. It will display available routes in the table and initiate the socket server.

Code Description
event(new Notify($data)); - send to all routes.
event(new Notify($data, $routes)); - send to routes in $routes array.
event(new Notify($data, $routes, $users)); - send to routes in $routes and only to users in $users.

Installation

For Laravel < 5.5 add provider to config/app.php

For publish notifier config file and js file for notifications out of the box:

and choose "Provider: MatviiB\Notifier\NotifierServiceProvider" if requested.

Starting server

Add worker daemon for process with Supervisor,

OR

Just run in terminal.

If you use SSL you need add to your nginx configuration file to server block:

Usage

At first you need to add @include('notifier::connect') before using socket.addEventListener() in your view or main layout to use it on ALL pages.

If you want use notifications from the scratch you need to add @include('notifier::connect_and_show') to the view.

Anywhere in your back-end add next event:

event(new Notify($data));

On front-end part add event listener

Use built-in notifications.

Built-in notifications is a vue.js with vue-notifications plugin. If you already use vue.js in application you can just add this plugin yourself.

Mapping $data parameter.
Parameter Description
'note' => 1, - use notes true
'type' => 'warn|success|error|info', - type of note
'title' => 'TEXT' - title of the note
'text' => 'Lorem ipsum' - note's body
Positioning.

In config/notifier.php you can modify position where notifications will be shown.

Security

This package allows one way messages - only from server to client.

All messages from client after connecting will be ignored.

From server side messages protected with socket_pass parameter from notifier config.

Channels to users protected with unique hash.

Example with charts

After installation add to web.php

create view /resources/views/chart.blade.php

In .env fix your APP_URL APP_URL=http://<<U APP URL>>

Create test command php artisan make:command Test

Run: php artisan notifier:init

Run in another shell: php artisan test

Open /chart page.

Usage Example

Send new values to chart on some page synchronously to each user:

event(new Notify($data, ['chart']));

Or to users with id 3 and 5: event(new Notify($data, ['chart'], [3, 5]));

laravel socket server


All versions of notifier with dependencies

PHP Build Version
Package Version
Requires laravel/framework Version ^5.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package matviib/notifier contains the following files

Loading the files please wait ....