PHPackages                             emuniq/filament-browser-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. emuniq/filament-browser-notifications

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

emuniq/filament-browser-notifications
=====================================

Zero-config browser push notifications for Filament. Piggybacks on database notifications — every sendToDatabase() automatically triggers a Web Push via VAPID.

v1.2.0(1mo ago)132.4k↑38.8%1MITPHPPHP ^8.1

Since May 26Pushed 3w ago1 watchersCompare

[ Source](https://github.com/Emuniq/filament-browser-notifications)[ Packagist](https://packagist.org/packages/emuniq/filament-browser-notifications)[ RSS](/packages/emuniq-filament-browser-notifications/feed)WikiDiscussions main Synced 1w ago

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

Filament Browser Notifications
==============================

[](#filament-browser-notifications)

[![Latest Version on Packagist](https://camo.githubusercontent.com/18a522312b48032945891453dd3b7c3436efa2187946fef6083801c0a6e68931/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f656d756e69712f66696c616d656e742d62726f777365722d6e6f74696669636174696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/emuniq/filament-browser-notifications)[![Total Downloads](https://camo.githubusercontent.com/02a9f7a0fdd98c887c9ec96267fb177437ac4f6c67023f24c480fee84aa794f3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f656d756e69712f66696c616d656e742d62726f777365722d6e6f74696669636174696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/emuniq/filament-browser-notifications)

**Every `sendToDatabase()` in your app automatically triggers a browser push notification — no code changes needed.**

[![Banner](art/banner.png)](art/banner.png)

Screenshots
-----------

[](#screenshots)

**Subscription prompt** — appears after a configurable delay, asking the user to enable push notifications.

[![Subscription prompt](art/prompt-banner.png)](art/prompt-banner.png)

**Profile section (inactive)** — auto-injected on the Edit Profile page. One-click to enable.

[![Profile section — inactive](art/profile-section.png)](art/profile-section.png)

**Profile section (active)** — shows subscription status, device count, and a button to disable.

[![Profile section — active](art/profile-active.png)](art/profile-active.png)

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

[](#installation)

```
composer require emuniq/filament-browser-notifications
php artisan browser-notifications:install
```

That's it. The install command handles everything:

- Generates VAPID keys and adds them to `.env`
- Publishes and runs the `push_subscriptions` migration
- Adds the `HasPushSubscriptions` trait to your User model automatically

No manual plugin registration needed — it auto-registers on all Filament panels. No service worker publishing needed — it's served from a route automatically. No profile page changes needed — the subscription management section auto-injects.

> **Note:** The trait step requires the process running `artisan` to have write access to your User model (e.g. `app/Models/User.php`). In setups where the model is read-only for PHP (common in some Docker images), the command skips that step and prints instructions to add the trait by hand — it won't fail the install. To do it manually, add the `HasPushSubscriptions` trait to your User model:
>
> ```
> use NotificationChannels\WebPush\HasPushSubscriptions;
>
> class User extends Authenticatable
> {
>     use HasPushSubscriptions, Notifiable;
> }
> ```

How it works
------------

[](#how-it-works)

```
Your existing code (unchanged)
|
|  Notification::make()->sendToDatabase($users)
|  $user->notify(new YourNotification)  // with 'database' channel
|
'-->  DatabaseNotification::created   Click: focuses app tab, navigates to action URL

```

Features
--------

[](#features)

**Core**

- Zero-config piggyback on `DatabaseNotification::created` — no per-notification wiring
- VAPID-only — no Firebase, no external WebSocket servers, no third-party dependencies
- Queued delivery — push dispatch runs as a background job
- Smart click handling — focuses existing tab and navigates, or opens new tab

**Throttle &amp; Grouping**

- Burst protection — multiple notifications within a configurable window (default 5s) are grouped into a single "You have N new notifications" push instead of spamming the user
- Configurable via `throttle_seconds` in config (set to 0 to disable)

**UI**

- Non-intrusive subscription prompt — styled Filament section banner, not the raw browser popup
- Dismiss cooldown — "Not now" hides the prompt for 7 days (configurable via localStorage)
- Opt-out respected — if user disables from profile, no re-subscription or prompt until they re-enable
- Profile section auto-injected — subscription management appears on the Edit Profile page automatically
- Dark mode support via native Filament components

**Plugin**

- Auto-registers on all Filament panels
- Auto-patches User model during install
- Service worker served from route (no asset publishing)
- Panel favicon used as push notification icon
- Dead subscription cleanup (410 Gone auto-deleted by webpush package)
- iOS PWA support — serves `manifest.json`, detects iOS Safari, guides users to Add to Home Screen
- i18n ready — ships with English and Spanish
- Filament 3, 4, and 5 compatible

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

[](#requirements)

- PHP 8.1+
- Laravel 10+ / Filament 3+
- HTTPS (required by the Web Push API)
- A queue worker (Horizon, `queue:work`, etc.)

iOS Support
-----------

[](#ios-support)

Push notifications on iOS require the app to be added to the Home Screen as a PWA. The plugin handles this automatically:

- Serves a `manifest.json` with `display: standalone` and icons from your panel favicon
- Injects Apple PWA meta tags
- Detects iOS Safari without PWA and shows "Add to Home Screen" instructions in the profile section
- Once added to Home Screen, the standard VAPID push flow works normally

The manifest's `start_url` and `theme_color` are derived from your active Filament panel — the panel **path** and **primary color** respectively — so the installed PWA opens the right route with on-brand chrome. Override either one in `config/browser-notifications.php` if needed:

```
'manifest' => [
    'start_url' => '/backoffice', // null = derive from the panel path
    'theme_color' => '#10B981',   // null = derive from the panel primary color
],
```

Testing your setup
------------------

[](#testing-your-setup)

After installation, verify push notifications work:

```
php artisan browser-notifications:test 1        # queue the test push
php artisan browser-notifications:test 1 --sync  # send immediately
```

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

[](#configuration)

Works out of the box. To customize, override the auto-registered plugin in your PanelProvider:

```
use Emuniq\FilamentBrowserNotifications\BrowserNotificationsPlugin;

->plugins([
    BrowserNotificationsPlugin::make()
        ->promptDelay(5)           // seconds before showing prompt (default: 2)
        ->dismissCooldownDays(14)  // days before re-prompting (default: 7)
        ->profileSection(false),   // disable auto-injected profile section
])
```

Publish the config for queue and throttle settings:

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

```
// config/browser-notifications.php
return [
    'prompt_delay' => 2,
    'queue_connection' => null,
    'queue_name' => null,
    'cleanup_dead_subscriptions' => true,
    'throttle_seconds' => 5,  // 0 to disable grouping
];
```

Suppressing push for specific notifications
-------------------------------------------

[](#suppressing-push-for-specific-notifications)

Add `'silent' => true` via the notification's view data to skip the push (Filament's `Notification` has no `->data()` method — use `->viewData()`):

```
Notification::make()
    ->title('Low priority update')
    ->body('...')
    ->viewData(['silent' => true])  // no browser push for this one
    ->sendToDatabase($users);
```

Translations
------------

[](#translations)

Ships with English and Spanish:

```
php artisan vendor:publish --tag=browser-notifications-lang
```

Docker / read-only `.env`
-------------------------

[](#docker--read-only-env)

Generate VAPID keys manually:

```
php artisan tinker --execute="echo json_encode(\Minishlink\WebPush\VAPID::createVapidKeys());"
```

Add to `.env`:

```
VAPID_PUBLIC_KEY=
VAPID_PRIVATE_KEY=
VAPID_SUBJECT=https://your-app.com

```

Architecture
------------

[](#architecture)

```
sendToDatabase() / $user->notify()
    | DatabaseNotification::created (Eloquent event)
    v
SendWebPushOnDatabaseNotification (Listener)
    | Checks: has subscriptions? silent? throttle window?
    v
SendDatabaseNotificationWebPush (Queued Job, delayed if throttled)
    | Counts recent unread notifications
    | 1 notification: sends original title/body
    | N notifications: sends grouped "You have N new notifications"
    v
GenericWebPushNotification -> WebPushChannel -> VAPID -> Push endpoint
    v
Service Worker (sw.js) -> showNotification() -> notificationclick -> navigate

```

License
-------

[](#license)

MIT

---

Maintained by [Emuniq](https://emuniq.com)
------------------------------------------

[](#maintained-by-emuniq)

This plugin is built and maintained by **Emuniq** — a Laravel &amp; Filament consultancy based in Mexico. We help teams ship admin panels, custom Filament resources, and SaaS backoffices.

- 🌐 Website: [emuniq.com](https://emuniq.com)
- 💼 Need a hand with your Filament project? [Get in touch](https://emuniq.com).
- ⭐ If this plugin saves you time, a [GitHub star](https://github.com/Emuniq/filament-browser-notifications) helps others find it.

###  Health Score

48

—

FairBetter than 94% of packages

Maintenance94

Actively maintained with recent releases

Popularity31

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 57.1% 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 ~8 days

Total

4

Last Release

33d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/227872768d209b013c1c0f320fc5144efc2bf537313ee299cbd4a5f8ee2a097b?d=identicon)[isach5](/maintainers/isach5)

---

Top Contributors

[![claude](https://avatars.githubusercontent.com/u/81847?v=4)](https://github.com/claude "claude (8 commits)")[![isach5](https://avatars.githubusercontent.com/u/150757961?v=4)](https://github.com/isach5 "isach5 (6 commits)")

---

Tags

laravelnotificationsfilamentpush notificationsservice workerWeb Pushvapidbrowser-notifications

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/emuniq-filament-browser-notifications/health.svg)

```
[![Health](https://phpackages.com/badges/emuniq-filament-browser-notifications/health.svg)](https://phpackages.com/packages/emuniq-filament-browser-notifications)
```

###  Alternatives

[backstage/mails

View logged mails and events in a beautiful Filament UI.

16121.5k](/packages/backstage-mails)[bentools/webpush-bundle

Send push notifications through Web Push Protocol to your Symfony users.

72290.6k](/packages/bentools-webpush-bundle)[finity-labs/fin-mail

A powerful email template manager and composer for Filament with dynamic token replacement, template versioning, and inline email sending.

284.8k2](/packages/finity-labs-fin-mail)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.8k](/packages/rawilk-profile-filament-plugin)[tomatophp/filament-accounts

Manage your multi accounts inside your app using 1 table with multi auth and a lot of integrations

748.6k7](/packages/tomatophp-filament-accounts)[usamamuneerchaudhary/filament-notifier

A powerful notification system for FilamentPHP that handles multi-channel notifications with template management, scheduling, and real-time delivery. Built for developers who need enterprise-grade notifications without the complexity.

342.1k](/packages/usamamuneerchaudhary-filament-notifier)

PHPackages © 2026

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