PHPackages                             herpaderpaldent/seat-notifications - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. herpaderpaldent/seat-notifications

AbandonedArchivedSeat-plugin[Mail &amp; Notifications](/categories/mail)

herpaderpaldent/seat-notifications
==================================

With this SeAT Package you can setup and manage notifications. It is build to be expendend from within the package or from another package

2.0.1(6y ago)21.6k7[11 issues](https://github.com/herpaderpaldent/seat-notifications/issues)MITPHPPHP &gt;=7.1

Since Jul 29Pushed 6y ago2 watchersCompare

[ Source](https://github.com/herpaderpaldent/seat-notifications)[ Packagist](https://packagist.org/packages/herpaderpaldent/seat-notifications)[ RSS](/packages/herpaderpaldent-seat-notifications/feed)WikiDiscussions develop Synced yesterday

READMEChangelog (10)Dependencies (7)Versions (22)Used By (0)

seat-notifications
==================

[](#seat-notifications)

With this [SeAT](https://github.com/eveseat/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](https://camo.githubusercontent.com/81997dee131bf09c7d6278d6fc26a616b409a92857ee46ae97c10513ca3c43ed/68747470733a2f2f706f7365722e707567782e6f72672f686572706164657270616c64656e742f736561742d6e6f74696669636174696f6e732f762f737461626c65)](https://packagist.org/packages/herpaderpaldent/seat-notifications)[![StyleCI](https://camo.githubusercontent.com/00d5d8c0fc1013638eb9b069f04bdfa1dd96253b23a3f5550d5e405ba63ad5f2/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3134303638303534312f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/140680541)[![Maintainability](https://camo.githubusercontent.com/f782abbf48204e242f544dce30b04d46425d1b237d0be1fa8d2e73f0c299938b/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f32323730393533636466616132323139376437382f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/herpaderpaldent/seat-notifications/maintainability)[![License](https://camo.githubusercontent.com/ebffc7215dcb6d7db915283f60373805b0a5795c5f9d155640545c5eeb1c1e2b/68747470733a2f2f706f7365722e707567782e6f72672f686572706164657270616c64656e742f736561742d6e6f74696669636174696f6e732f6c6963656e7365)](https://packagist.org/packages/herpaderpaldent/seat-notifications)[![Total Downloads](https://camo.githubusercontent.com/c90baa1baaf730512a2d8804ad113789b4c217c7d1b909ec613468b30d0f99d2/68747470733a2f2f706f7365722e707567782e6f72672f686572706164657270616c64656e742f736561742d6e6f74696669636174696f6e732f646f776e6c6f616473)](https://packagist.org/packages/herpaderpaldent/seat-notifications)

***Important**: seat-notifications are work in progress and certainly have some bugs please do report any findings to [seat-slack](https://eveseat-slack.herokuapp.com/) and report it as an issue*.

Installation
------------

[](#installation)

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

### Enable Notification Channel

[](#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](https://camo.githubusercontent.com/71a8f036b59501fae54ee04ff1f6b100f71ef92e5bf1121d5b10fd9e3805496e/68747470733a2f2f692e696d6775722e636f6d2f3375655449614f2e706e67)](https://camo.githubusercontent.com/71a8f036b59501fae54ee04ff1f6b100f71ef92e5bf1121d5b10fd9e3805496e/68747470733a2f2f692e696d6775722e636f6d2f3375655449614f2e706e67)

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

Notification ChannelRedirect URLsCommentDiscord{seat\_url}/seatnotifications/discord/configuration/callback/serverThis callback url is needed for the configuration of your discord bot.Discord{seat\_url}/seatnotifications/discord/callback/userThis callback url is needed for the authentication of a discord user.Slack{seat\_url}/seatnotifications/slack/configuration/callback/serverThis callback url is needed for the configuration of your slack bot.Slack{seat\_url}/seatnotifications/slack/callback/userThis 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

[](#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

[](#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

[](#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
--------------------------------------

[](#what-does-the-package-do-at-the-moment)

- Send `RefreshTokenDeleted` Notification to Discord and/or Slack when a `refresh_token` is deleted.
- Using Model Observer to dispatch Notifications
- Notifications are queueable and send out via the queue.
- The RefreshTokenNotification is able to be delivered to Channels or via DM on the users preference.

Example: [![image](https://user-images.githubusercontent.com/6583519/50541121-0f8b3e00-0b9f-11e9-9319-1a4512376271.png)](https://user-images.githubusercontent.com/6583519/50541121-0f8b3e00-0b9f-11e9-9319-1a4512376271.png)[![picture](https://camo.githubusercontent.com/6ec4ebc20b9f53be2fcc5ab407a394f38b12da120e57fed3887e54e4206e2494/68747470733a2f2f692e696d6775722e636f6d2f696d67363475362e706e67)](https://camo.githubusercontent.com/6ec4ebc20b9f53be2fcc5ab407a394f38b12da120e57fed3887e54e4206e2494/68747470733a2f2f692e696d6775722e636f6d2f696d67363475362e706e67)

Developing
----------

[](#developing)

Most importantly: take note of [laravel's notification documentation](https://laravel.com/docs/5.5/notifications). Secondly have a look at [this package service provider](https://github.com/herpaderpaldent/seat-notifications/blob/master/src/SeatNotificationsServiceProvider.php) as it helps with merging the services array properly. The provided example of [RefreshTokenDeletedNotification](https://github.com/herpaderpaldent/seat-notifications/blob/master/src/Notifications/RefreshTokenDeletedNotification.php) is based upon it. Notifications are being send by using the `Notification` facade:

```
Notification::send($receipients, (new RefreshTokenDeletedNotification($refresh_token)));

```

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](https://github.com/herpaderpaldent/seat-notifications/blob/master/src/Observers/RefreshTokenObserver.php).

### Architecture

[](#architecture)

[![uml_diagram](https://camo.githubusercontent.com/a404c653b5709427066ee2403f131ab084e531a253a3427490b67f74bc45a1a8/68747470733a2f2f79756d6c2e6d652f6469616772616d2f736372756666792f636c6173732f253542253343253343494e6f74696669636174696f6e25334525334525374262673a64656570736b79626c75652537442535442535452d2e2d25354241627374726163744e6f74696669636174696f6e25374262673a64656570736b79626c75652537442535442c25354241627374726163744e6f74696669636174696f6e253544253545253542416273747261637452656672657368546f6b656e4e6f74696669636174696f6e2535442c253542416273747261637452656672657368546f6b656e4e6f74696669636174696f6e253544253545253542446973636f726452656672657368546f6b656e4e6f74696669636174696f6e25374262673a79656c6c6f77677265656e2537442535442c253542416273747261637452656672657368546f6b656e4e6f74696669636174696f6e25374262673a79656c6c6f77677265656e253744253544253545253542536c61636b52656672657368546f6b656e4e6f74696669636174696f6e25374262673a79656c6c6f77677265656e2537442535442c25354241627374726163744e6f74696669636174696f6e2535442b2b2d253345253542253343253343494e6f74696669636174696f6e4472697665722533452533452535442c253542253343253343494e6f74696669636174696f6e4472697665722533452533452535442535452d2e2d253542446973636f72644e6f74696669636174696f6e44726976657225374262673a6c69676874736561677265656e2537442535442c253542253343253343494e6f74696669636174696f6e44726976657225334525334525374262673a6c69676874736561677265656e2537442535442535452d2e2d253542536c61636b4e6f74696669636174696f6e44726976657225374262673a6c69676874736561677265656e2537442535442c25354241627374726163744e6f74696669636174696f6e253544757365732532302d2e2d2533452535424e6f74696669636174696f6e537562736372697074696f6e25374262673a6f72616e67652537442535442c2535424e6f74696669636174696f6e537562736372697074696f6e2535442b2b2d2533452535424e6f74696669636174696f6e526563697069656e7425374262673a6f72616e67652537442535442c2535424e6f74696669636174696f6e526563697069656e742535442b2b2d3125334525354247726f757025374262673a746f6d61746f2537442535442c25354247726f75702535442b2b2d2533452535425573657225374262673a746f6d61746f253744253544)](https://camo.githubusercontent.com/a404c653b5709427066ee2403f131ab084e531a253a3427490b67f74bc45a1a8/68747470733a2f2f79756d6c2e6d652f6469616772616d2f736372756666792f636c6173732f253542253343253343494e6f74696669636174696f6e25334525334525374262673a64656570736b79626c75652537442535442535452d2e2d25354241627374726163744e6f74696669636174696f6e25374262673a64656570736b79626c75652537442535442c25354241627374726163744e6f74696669636174696f6e253544253545253542416273747261637452656672657368546f6b656e4e6f74696669636174696f6e2535442c253542416273747261637452656672657368546f6b656e4e6f74696669636174696f6e253544253545253542446973636f726452656672657368546f6b656e4e6f74696669636174696f6e25374262673a79656c6c6f77677265656e2537442535442c253542416273747261637452656672657368546f6b656e4e6f74696669636174696f6e25374262673a79656c6c6f77677265656e253744253544253545253542536c61636b52656672657368546f6b656e4e6f74696669636174696f6e25374262673a79656c6c6f77677265656e2537442535442c25354241627374726163744e6f74696669636174696f6e2535442b2b2d253345253542253343253343494e6f74696669636174696f6e4472697665722533452533452535442c253542253343253343494e6f74696669636174696f6e4472697665722533452533452535442535452d2e2d253542446973636f72644e6f74696669636174696f6e44726976657225374262673a6c69676874736561677265656e2537442535442c253542253343253343494e6f74696669636174696f6e44726976657225334525334525374262673a6c69676874736561677265656e2537442535442535452d2e2d253542536c61636b4e6f74696669636174696f6e44726976657225374262673a6c69676874736561677265656e2537442535442c25354241627374726163744e6f74696669636174696f6e253544757365732532302d2e2d2533452535424e6f74696669636174696f6e537562736372697074696f6e25374262673a6f72616e67652537442535442c2535424e6f74696669636174696f6e537562736372697074696f6e2535442b2b2d2533452535424e6f74696669636174696f6e526563697069656e7425374262673a6f72616e67652537442535442c2535424e6f74696669636174696f6e526563697069656e742535442b2b2d3125334525354247726f757025374262673a746f6d61746f2537442535442c25354247726f75702535442b2b2d2533452535425573657225374262673a746f6d61746f253744253544)

### Add new drivers

[](#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:

```
'seat-notification-channel' => [
        'discord'   => Herpaderpaldent\Seat\SeatNotifications\Drivers\DiscordNotificationDriver::class,
    ],

```

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

```
    /**
     * The view name which will be used to store the channel settings.
     *
     * @return string
     */
    public static function getSettingsView() : string;

    /**
     * The label which will be applied to the subscription button.
     *
     * @return string
     */
    public static function getButtonLabel() : string;

    /**
     * The CSS class which have to be append into the subscription button.
     *
     * @return string
     */
    public static function getButtonIconClass() : string;

    /**
     * @return array
     */
    public static function getChannels() : array;

    /**
     * Determine if a channel has been properly setup.
     *
     * @return bool
     */
    public static function isSetup(): bool;

```

### Add new notifications

[](#add-new-notifications)

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

```
'seat-notification'         => [
         // notification => [provider => implementation]
         Herpaderpaldent\Seat\SeatNotifications\Notifications\RefreshToken\AbstractRefreshTokenNotification::class => [
             'discord' => Herpaderpaldent\Seat\SeatNotifications\Notifications\RefreshToken\DiscordRefreshTokenNotification::class,
             'slack'   => Herpaderpaldent\Seat\SeatNotifications\Notifications\RefreshToken\SlackRefreshTokenNotification::class,
         ],

```

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

```
    /**
     * Return a title for the notification which will be displayed in UI notification list.
     * @return string
     */
    public static function getTitle(): string;

    /**
     * Return a description for the notification which will be displayed in UI notification list.
     * @return string
     */
    public static function getDescription(): string;

    /**
     * Determine if a notification can target public channel (forum category, chat, etc...).
     * @return bool
     */
    public static function isPublic(): bool;

    /**
     * Determine if a notification can target personal channel (private message, e-mail, etc...).
     * @return bool
     */
    public static function isPersonal(): bool;

    /**
     * Determine the permission needed to represent driver buttons.
     * @return string
     */
    public static function getPermission(): string;

```

### Use Notification Dispatcher

[](#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.:

```
 public function handle()
    {
        Redis::funnel('soft_delete:refresh_token_' . $this->refresh_token->user->id)->limit(1)->then(function () {
            logger()->info('SoftDelete detected of ' . $this->refresh_token->user->name);

            $recipients = NotificationRecipient::all()
                ->filter(function ($recipient) {
                    return $recipient->shouldReceive(AbstractRefreshTokenNotification::class);
                });

            if($recipients->isEmpty()){
                logger()->debug('No Receiver found for this Notification. This job is going to be deleted.');
                $this->delete();
            }

            $recipients->groupBy('driver')
                ->each(function ($grouped_recipients) {
                    $driver = (string) $grouped_recipients->first()->driver;
                    $notification_class = AbstractRefreshTokenNotification::getDriverImplementation($driver);

                    Notification::send($grouped_recipients, (new $notification_class($this->refresh_token)));
                });

        }, function () {

            logger()->debug('A Soft-Delete job is already running for ' . $this->refresh_token->user->name);
            $this->delete();
        });
    }
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~20 days

Recently: every ~50 days

Total

20

Last Release

2451d ago

Major Versions

0.9.1 → 1.0.02018-12-30

1.1.2 → 2.0.0-rc.12019-03-22

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6583519?v=4)[Herpaderp Aldent](/maintainers/herpaderpaldent)[@herpaderpaldent](https://github.com/herpaderpaldent)

---

Top Contributors

[![herpaderpaldent](https://avatars.githubusercontent.com/u/6583519?v=4)](https://github.com/herpaderpaldent "herpaderpaldent (107 commits)")

### Embed Badge

![Health badge](/badges/herpaderpaldent-seat-notifications/health.svg)

```
[![Health](https://phpackages.com/badges/herpaderpaldent-seat-notifications/health.svg)](https://phpackages.com/packages/herpaderpaldent-seat-notifications)
```

###  Alternatives

[spatie/laravel-failed-job-monitor

Get notified when a queued job fails

1.0k2.6M4](/packages/spatie-laravel-failed-job-monitor)[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)[vemcogroup/laravel-sparkpost-driver

SparkPost driver to use with Laravel 6.x|7.x|8.x|9.x|10.x

421.7M1](/packages/vemcogroup-laravel-sparkpost-driver)[spatie/mailcoach

Self-host Mailcoach

4007.0k](/packages/spatie-mailcoach)[dotdigital/dotdigital-magento2-extension

Dotdigital for Magento 2

50374.2k18](/packages/dotdigital-dotdigital-magento2-extension)[synergitech/laravel-postal

This library integrates Postal with the standard Laravel mail framework.

38107.1k](/packages/synergitech-laravel-postal)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
