Download the PHP package herpaderpaldent/seat-notifications without Composer

On this page you can find all versions of the php package herpaderpaldent/seat-notifications. 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 seat-notifications

seat-notifications

With this SeAT Package you can setup and manage notifications. It is build to be expended from within the package or from another package. Please read more about it further down.

Latest Stable Version StyleCI Maintainability License Total Downloads

Important: seat-notifications are work in progress and certainly have some bugs please do report any findings to seat-slack and report it as an issue.

Installation

  1. cd to /var/www/seat
  2. enter composer require herpaderpaldent/seat-notifications
  3. run migration php artisan migrate

Enable Notification Channel

To enable seat-notifications functionality of sending notifications. Create a bot for your notification channel. By default seat-notifications offers two notification channels which could be extended by other packages: slack and discord: configure

a more detailed guide on oAuth creation will follow for now the blow table must suffice:

Notification Channel Redirect URLs Comment
Discord {seat_url}/seatnotifications/discord/configuration/callback/server This callback url is needed for the configuration of your discord bot.
Discord {seat_url}/seatnotifications/discord/callback/user This callback url is needed for the authentication of a discord user.
Slack {seat_url}/seatnotifications/slack/configuration/callback/server This callback url is needed for the configuration of your slack bot.
Slack {seat_url}/seatnotifications/slack/callback/user This callback url is needed for the authentication of a slack user.

Note: you may only configure one notification channel at your will. However, for discord you must create a bot in your application. For Slack you need to add the bot permission to your oauth scope.

Setup Roles

To be able to subscribe to a notification the user needs the appropriate permission. Please setup a role that carries the needed permission and assign it to users that should be able to receive the notification.

Restart workers

Since the notifications are send out by your workers you need to restart them to pick up the new code. Do this either via docker-compose restart seat-worker if you use docker, or supervisorctl restart worker on linux distributions.

Authenticate

Users need to authenticate for your setup notification channel prior to receiving notifications. they may do this in the registration box on the notification page.

What does the package do at the moment

Example: image picture

Developing

Most importantly: take note of laravel's notification documentation. Secondly have a look at this package service provider as it helps with merging the services array properly. The provided example of RefreshTokenDeletedNotification is based upon it. Notifications are being send by using the Notification facade:

where $receipients are a collection of modal that should receive the notification and $refresh_token is the deleted refresh_token that is passed to the constructor. In this example we use an Observer to send notifications: Observer.

Architecture

uml_diagram

Add new drivers

If you have written a new notification driver that you would like to use for sending notifications to your users you might extend config/services.php similar to the provided example:

Your driver should extend Herpaderpaldent\Seat\SeatNotifications\Drivers\AbstractNotificationDriver and should contain;

Add new notifications

If you want to extend the available notifications you need to extend the seat-notification array in config/services.php:

Your abstract notification must extend Herpaderpaldent\Seat\SeatNotifications\Notifications\AbstractNotification and contain the following methods to add your notification to the users notification list:

Use Notification Dispatcher

In order to dispatch notification solely to receiver that subscribed to the notification it is advised to use a custom dispatcher job f.e.:

``


All versions of seat-notifications with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
laravel/framework Version 5.5.*
eveseat/web Version ~3.0.15
erusev/parsedown Version ^1.7
textalk/websocket Version 1.0.*
restcord/restcord Version ^0.3
php-http/curl-client Version ^1.7
jolicode/slack-php-api Version ^1.0
ext-json Version *
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 herpaderpaldent/seat-notifications contains the following files

Loading the files please wait ....