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

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

ranger/notification
===================

Realtime user-to-user notifications for Laravel: Eloquent-backed, broadcast over private channels, with a drop-in bell dropdown view.

v1.0.0(4w ago)32MITPHPPHP ^8.2CI passing

Since Jul 20Pushed 4w ago1 watchersCompare

[ Source](https://github.com/i-sazzad/notification)[ Packagist](https://packagist.org/packages/ranger/notification)[ RSS](/packages/ranger-notification/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (9)Versions (3)Used By (0)

ranger/notification
===================

[](#rangernotification)

Realtime user-to-user notifications for Laravel. Eloquent-backed, broadcast over private channels via Laravel's own broadcasting system (Reverb, Pusher, Ably — whatever your app uses), with a drop-in bell dropdown view.

Requirements
------------

[](#requirements)

- PHP 8.2+
- Laravel 11 or 12
- (Optional, for realtime) a configured broadcast driver and Laravel Echo

> **Note for Laravel 11 apps:** Laravel 11 is past its security-fix window and has open security advisories, so Composer 2.10+ refuses to install it by default. If your app is still on Laravel 11 you have already dealt with this, but for a fresh install you may need: `composer config policy.advisories.block false`

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

[](#installation)

```
composer require ranger/notification
php artisan migrate
```

The service provider is auto-discovered. The migration creates a `ranger_notifications` table.

Optionally publish the config, views, or migration:

```
php artisan vendor:publish --tag=notification-config
php artisan vendor:publish --tag=notification-views
php artisan vendor:publish --tag=notification-migrations
```

Sending notifications
---------------------

[](#sending-notifications)

From anywhere in your app (controller, job, listener):

```
use Ranger\Notification\Notifier;

app(Notifier::class)->send(
    fromUserId: auth()->id(),   // or null for system notifications
    toUserIds: [3, 7, 12],      // one id or an array
    message: 'A new order was placed.'
);
```

Each recipient gets their own row and, when broadcasting is enabled, a `notification.created` event on their private channel `notifications.{userId}`. Channel authorization is registered by the package: users can only subscribe to their own channel.

HTTP endpoints
--------------

[](#http-endpoints)

Registered automatically under the configurable prefix (default `/notifications`) behind `['web', 'auth']` middleware:

MethodURINameReturnsGET/notificationsnotifications.index`{ unread_count, notifications:  }`POST/notifications/{id}/readnotifications.read`{ status: "ok" }` (404 if not yours)POST/notifications/read-allnotifications.read-all`{ status: "ok" }`There is intentionally no HTTP endpoint for *creating* notifications — send them from server-side code with `Notifier::send()`.

Bell dropdown view
------------------

[](#bell-dropdown-view)

Add to any Blade layout used by authenticated pages:

```
@include('notification::bell')
```

Requirements in your layout:

- `` in ``
- (Optional) Laravel Echo configured on `window.Echo` for realtime badge updates; without it the bell still works and refreshes when opened.

Configuration
-------------

[](#configuration)

`config/notification.php`:

```
return [
    'route' => [
        'prefix' => 'notifications',
        'middleware' => ['web', 'auth'],
    ],
    'broadcast' => [
        'enabled' => true,
        'channel_prefix' => 'notifications',
    ],
];
```

Testing
-------

[](#testing)

```
composer test
```

License
-------

[](#license)

MIT — see [LICENSE.md](LICENSE.md).

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance94

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

28d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6317a501de643e5fe69806ae46da55b51088300ced52f4e0563c13a485d445bc?d=identicon)[i\_sazzad](/maintainers/i_sazzad)

![](https://avatars.githubusercontent.com/u/130813?v=4)[Tanvir Ahmad](/maintainers/Tanvir)[@tanvir](https://github.com/tanvir)

---

Top Contributors

[![i-sazzad](https://avatars.githubusercontent.com/u/16065339?v=4)](https://github.com/i-sazzad "i-sazzad (1 commits)")

---

Tags

laravelnotificationrealtimeBroadcasting

### Embed Badge

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

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.4M354](/packages/psalm-plugin-laravel)[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.6k31.8M160](/packages/laravel-cashier)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45844.8k1](/packages/pressbooks-pressbooks)[api-platform/laravel

API Platform support for Laravel

58190.1k21](/packages/api-platform-laravel)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9922.4M146](/packages/roots-acorn)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k16.3M154](/packages/laravel-pulse)

PHPackages © 2026

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