Download the PHP package ivfuture/laravel-event-notification without Composer

On this page you can find all versions of the php package ivfuture/laravel-event-notification. 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 laravel-event-notification

Laravel Event Notification

This package provides an easy way to integrate notifications with Laravel 6, Redis and socket.io . After the installation the user will be able to receive real time notification.

Here are some examples:

Installation

You can install this package via composer using:

To register the package you have to add the service provider in your file:

Now you should publish the migration with:

After the migration have been published you can create the tables by running the migrations:

Next, we have to install the npm packages:

Settings

First of all, you have to edit your file to tell Laravel to use the correct .

If you are using an older version of Laravel you may skip the next step. You have to edit your file and comment the line that is adding a prefix to redis:

Starting the servers

Now all you have to do is start the servers.

Usage

After you've installed the package and done all the settings it's time to integrate the notifications in your project.

First, don't forget to import the trait at the top of your file.

Subscribe to channels notification

In your Controller constructor you must subscribe to the channels. You can do this by using 's function . It will search in table for channels and will automatically subscribe to them.

Send a notification

There is also a convenient function for sending a notification:

This will save the notification into the database and will send an event with all its data.

Get notifications from database

You can get the notifications from database:

This will provide us with notifications grouped by time categories like: , , or .

Receive the notification in view

To receive real time notifications you must follow this 3 steps:

1 - Import socket.io library

2 - Create a Socket object.

Note: By default the server wil listen for port 3000. You can change that by editing the value of in your file.

3 - Listen to the channel from which notification was sent.

Note: If you have many channels, you must listen to all of them.

Example:

And finally, don't forget to check if the user is the receiver of notification.


All versions of laravel-event-notification with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2
predis/predis Version ^1.1
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 ivfuture/laravel-event-notification contains the following files

Loading the files please wait ....