PHPackages                             nguyentrigiang/laravel-notification - 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. nguyentrigiang/laravel-notification

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

nguyentrigiang/laravel-notification
===================================

A Package for management notification with jsonapi specification

v1.4.1(5y ago)313MITPHPPHP ^7.3

Since Sep 23Pushed 4y ago1 watchersCompare

[ Source](https://github.com/nguyentrigiang/laravel-notification)[ Packagist](https://packagist.org/packages/nguyentrigiang/laravel-notification)[ Docs](https://github.com/giangnguyentri/notifications)[ RSS](/packages/nguyentrigiang-laravel-notification/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (1)Dependencies (2)Versions (7)Used By (0)

[![Build Status](https://camo.githubusercontent.com/1ec5842cb2c08810026f4ece27857e02c98135c231b3c7c230b58aae671ebea6/68747470733a2f2f7472617669732d63692e6f72672f6e677579656e7472696769616e672f6c61726176656c2d6e6f74696669636174696f6e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/nguyentrigiang/laravel-notification)[![License](https://camo.githubusercontent.com/f50598193fc13f3fe1cf619c52c6a4c57583345eb5963c16021b3ad3d6379fdb/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6e677579656e7472696769616e672f6c61726176656c2d6e6f74696669636174696f6e2e737667)](https://github.com/nguyentrigiang/laravel-notification/blob/master/LICENSE)

Introduction
============

[](#introduction)

This is a simple Notification wrapper library for Laravel. It simplifies the basic notification flow with the defined methods. You can send a message to all users or you can notify a single user, manage notifications, devices ID, and configure time to receive notifications.

Installation
============

[](#installation)

First, you'll need to require the package with Composer:

```
composer require nguyentrigiang/laravel-notification
```

The package will automatically register a service provider.

Then, run `php artisan vendor:publish --provider="GiangNT\LaravelNotification\NotificationServiceProvider"` from your command line to publish the notification migration file.

Finally, from the command line again, run

```
php artisan migrate

```

Configuration
=============

[](#configuration)

If you use Onesignal, run

```
php artisan vendor:publish --tag=config
```

to publish the default configuration file. This will publish a configuration file named onesignal.php which includes your OneSignal authorization keys.

You need to fill in onesignal.php file that is found in your applications config directory. app\_id is your OneSignal App ID and rest\_api\_key is your REST API Key.

USAGE
=====

[](#usage)

Preparing your model:
---------------------

[](#preparing-your-model)

To associate notification with a model, the model must implement the following interface and trait

```
namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use GiangNT\LaravelNotification\HasPlayer;
use GiangNT\LaravelNotification\HasConfiguration;
use GiangNT\LaravelNotification\InteractsWithPlayer;
use GiangNT\LaravelNotification\InteractsWithConfiguration;
use Illuminate\Notifications\Notifiable;

class User extends Model implements HasPlayer, HasConfiguration
{
    use InteractsWithPlayer, InteractsWithConfiguration, Notifiable;
}
```

Creating Notifications:
-----------------------

[](#creating-notifications)

```
php artisan make:notification InvoicePaid
```

Extends `GiangNT\LaravelNotification\BaseNotification` instead of `Illuminate\Notifications\Notification`

```
use GiangNT\LaravelNotification\BaseNotification;

class UserRegisted extends BaseNotification
{
}
```

Sending Notifications:
----------------------

[](#sending-notifications)

```
use App\Notifications\InvoicePaid;

$user->notify(new InvoicePaid($invoice));
```

Accessing The Notifications
---------------------------

[](#accessing-the-notifications)

```
$user = App\Models\User::find(1);

foreach ($user->notifications as $notification) {
    echo $notification->type;
}
```

Interacts with Player
---------------------

[](#interacts-with-player)

```
$user->addPlayer('5ea79c81-327f-4d8b-98b1-58dbd22a277b');
$players = $user->players;
$user->deletePlayer('5ea79c81-327f-4d8b-98b1-58dbd22a277b');
$user->clearPlayer();
```

Interacts with Configuration
----------------------------

[](#interacts-with-configuration)

```
$data = [
    'start_time' => '5:00',
    'end_time' => '21:59',
    'days_of_the_week' => ['Monday', 'Tuesday']
];
$user->addConfiguration($data);
$user->resetConfiguration();
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 77.3% 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 ~5 days

Total

5

Last Release

2036d ago

PHP version history (2 changes)v1.3PHP ^7.1

v1.3.3PHP ^7.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/19281952?v=4)[Nguyen Tri Giang](/maintainers/nguyentrigiang)[@nguyentrigiang](https://github.com/nguyentrigiang)

---

Top Contributors

[![giangnguyentri](https://avatars.githubusercontent.com/u/33085593?v=4)](https://github.com/giangnguyentri "giangnguyentri (17 commits)")[![nguyentrigiang](https://avatars.githubusercontent.com/u/19281952?v=4)](https://github.com/nguyentrigiang "nguyentrigiang (5 commits)")

---

Tags

notificationnguyentrigiang

### Embed Badge

![Health badge](/badges/nguyentrigiang-laravel-notification/health.svg)

```
[![Health](https://phpackages.com/badges/nguyentrigiang-laravel-notification/health.svg)](https://phpackages.com/packages/nguyentrigiang-laravel-notification)
```

###  Alternatives

[symfony/notifier

Sends notifications via one or more channels (email, SMS, ...)

80640.3M290](/packages/symfony-notifier)[jolicode/jolinotif

Send desktop notifications on Windows, Linux, MacOS.

1.4k11.6M41](/packages/jolicode-jolinotif)[duccio/apns-php

Apple Push Notification &amp; Feedback Provider

1.4k2.5M13](/packages/duccio-apns-php)[laravel-notification-channels/telegram

Telegram Notifications Channel for Laravel

1.1k3.4M35](/packages/laravel-notification-channels-telegram)[mckenziearts/laravel-notify

Flexible flash notifications for Laravel

1.7k1.1M5](/packages/mckenziearts-laravel-notify)[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2587.7M12](/packages/laravel-notification-channels-twilio)

PHPackages © 2026

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