PHPackages                             xentixar/filament-push-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. xentixar/filament-push-notifications

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

xentixar/filament-push-notifications
====================================

This package provides a way to send push notifications to users of your application.

1.0.1(8mo ago)17929↑566.7%3[1 issues](https://github.com/xentixar/filament-push-notifications/issues)MITPHP

Since Sep 2Pushed 4mo agoCompare

[ Source](https://github.com/xentixar/filament-push-notifications)[ Packagist](https://packagist.org/packages/xentixar/filament-push-notifications)[ RSS](/packages/xentixar-filament-push-notifications/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (4)Used By (0)

Filament Push Notifications
===========================

[](#filament-push-notifications)

[![Latest Version on Packagist](https://camo.githubusercontent.com/174744f78ce485e0266960559850970080182fa72bb0376e07e92670aa6fed7a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f78656e74697861722f66696c616d656e742d707573682d6e6f74696669636174696f6e732e737667)](https://packagist.org/packages/xentixar/filament-push-notifications)[![Total Downloads](https://camo.githubusercontent.com/584282f5a64970d9e63d6365ae8746539a239cfc4dffcaba7a5e21360b5746fb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f78656e74697861722f66696c616d656e742d707573682d6e6f74696669636174696f6e732e737667)](https://packagist.org/packages/xentixar/filament-push-notifications)[![License](https://camo.githubusercontent.com/e61cbf6d1bf07c3af94bf4c38d883befe564067eec7f1b4a75723464e70f1586/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f78656e74697861722f66696c616d656e742d707573682d6e6f74696669636174696f6e732e737667)](https://packagist.org/packages/xentixar/filament-push-notifications)

A comprehensive Laravel package that provides real-time push notifications for Filament applications. Native notifications use the Web Push API with service workers for persistent delivery, while local notifications provide in-app toast-style alerts. Built with WebSocket technology for instant real-time delivery.

✨ Features
----------

[](#-features)

- **Real-time Notifications**: Instant push notifications using WebSocket technology
- **Web Push API**: Native notifications use service workers for persistent delivery (even when browser is closed)
- **Dual Notification Types**: Support for both native (web push) and in-app local notifications
- **Scheduled Notifications**: Schedule notifications to be sent at specific times
- **User Targeting**: Send notifications to specific users or groups
- **Filament Admin Panel**: Complete admin interface for managing notifications
- **Service Worker Integration**: Automatic service worker registration and management
- **Push Subscription Management**: Easy subscribe/unsubscribe with visual UI toggle
- **WebSocket Integration**: Built-in WebSocket server using Sockeon for real-time delivery
- **Queue Support**: Background job processing for better performance
- **VAPID Authentication**: Secure web push with VAPID keys
- **Customizable Configuration**: Extensive configuration options for all aspects
- **Migration Ready**: Automatic database setup and migrations

� Documentation
---------------

[](#-documentation)

- [Installation Guide](#-installation)
- [Configuration](#-configuration)
- [Usage](#-usage)
- [**Upgrading from 1.x to 2.x**](UPGRADE.md) ⬆️

�🚀 Installation
---------------

[](#-installation)

### Prerequisites

[](#prerequisites)

- Laravel 11.x or higher
- PHP 8.2 or higher
- Filament 4.x
- Composer

### Step 1: Install the Package

[](#step-1-install-the-package)

```
composer require xentixar/filament-push-notifications
```

### Step 2: Publish Configuration and Migrations

[](#step-2-publish-configuration-and-migrations)

```
php artisan vendor:publish --tag=filament-push-notifications-config
php artisan vendor:publish --tag=filament-push-notifications-migrations
```

### Step 3: Run Migrations

[](#step-3-run-migrations)

```
php artisan migrate
```

### Step 4: Add Plugin to Admin Panel Provider

[](#step-4-add-plugin-to-admin-panel-provider)

Add the push notifications plugin to your `app/Providers/Filament/AdminPanelProvider.php`:

```
use Xentixar\FilamentPushNotifications\PushNotification;

class AdminPanelProvider extends PanelProvider
{
    public function panel(Panel $panel): Panel
    {
        return $panel
            // ... other configuration
            ->plugins([
                // ... other plugins
                PushNotification::make(),
            ]);
    }
}
```

### Step 5: Generate VAPID Keys

[](#step-5-generate-vapid-keys)

Generate VAPID keys for web push notifications:

```
php artisan push:generate-vapid-keys --update-env
```

This will generate and add the VAPID keys to your `.env` file automatically.

### Step 6: Publish Service Worker

[](#step-6-publish-service-worker)

Publish the service worker to your public directory:

```
php artisan vendor:publish --tag=filament-push-notifications-assets
```

### Step 7: Configure Environment Variables

[](#step-7-configure-environment-variables)

Add the following variables to your `.env` file:

```
# WebSocket Server Configuration
SOCKEON_HOST=localhost
SOCKEON_PORT=8080
SOCKEON_KEY=your-secret-key
SOCKEON_DEBUG=true

# Web Push VAPID Keys (Generated via: php artisan push:generate-vapid-keys)
VAPID_PUBLIC_KEY="your-public-key"
VAPID_PRIVATE_KEY="your-private-key"
VAPID_SUBJECT="mailto:admin@example.com"

# Web Push Configuration (Optional)
WEB_PUSH_TTL=2419200
WEB_PUSH_URGENCY=normal

# Native Notification Configuration (Optional)
NOTIFICATION_FAVICON=https://your-domain.com/favicon.ico
NOTIFICATION_DEFAULT_URL=https://your-domain.com
NOTIFICATION_TAG=default
NOTIFICATION_REQUIRE_INTERACTION=false
NOTIFICATION_SILENT=false
NOTIFICATION_BADGE=https://your-domain.com/badge.ico
NOTIFICATION_DIR=auto
NOTIFICATION_LANG=en
NOTIFICATION_RENOTIFY=false
NOTIFICATION_TIMEOUT=5000
```

🔧 Configuration
---------------

[](#-configuration)

The package configuration file is located at `config/filament-push-notifications.php`. You can customize:

- Web Push settings (VAPID keys, TTL, urgency)
- WebSocket server settings
- Native notification options (icons, badges, vibration patterns, etc.)

Refer to the config file for all available options.

📱 Usage
-------

[](#-usage)

### Starting the WebSocket Server

[](#starting-the-websocket-server)

```
php artisan start:sockeon
```

🎯 Notification Types
--------------------

[](#-notification-types)

### Native Notifications (Web Push)

[](#native-notifications-web-push)

Native notifications use the Web Push API with service workers for persistent delivery:

- **Persistent**: Work even when the browser is closed
- **Service Worker**: Automatic registration and management
- **VAPID Authentication**: Secure delivery with VAPID keys
- **Subscription Management**: Easy subscribe/unsubscribe with UI toggle
- **Custom icons and badges**: Fully customizable appearance
- **Click actions**: Navigate to URLs on notification click
- **Vibration patterns**: Mobile device support
- **Rich options**: Sound, interaction requirements, and more

Users must subscribe to web push notifications by clicking the "Enable Web Push" button that appears in the bottom-right corner of the Filament admin panel.

### Local Notifications (In-App)

[](#local-notifications-in-app)

In-app notifications that appear within the Filament admin panel:

- Toast-style notifications
- Customizable appearance
- Auto-dismiss functionality
- Progress indicators
- Dark mode support

🚀 Production Deployment
-----------------------

[](#-production-deployment)

### SSL/WSS Support

[](#sslwss-support)

For production HTTPS sites, you need to configure WSS (secure WebSocket). Sockeon supports this through a reverse proxy like Nginx.

**1. Create a Subdomain (Recommended)**Create a subdomain for your WebSocket server (e.g., `ws.your-domain.com`).

**2. Configure Environment Variables**Update your `.env` file to separate the bind address from the public address:

```
# Server Binding (Internal)
SOCKEON_HOST=127.0.0.1
SOCKEON_PORT=8080

# Public Connection (External)
SOCKEON_EXTERNAL_HOST=ws.your-domain.com
SOCKEON_EXTERNAL_PORT=443
```

**3. Configure Nginx**Point the subdomain to your internal Sockeon server:

```
server {
    listen 443 ssl http2;
    server_name ws.your-domain.com;

    ssl_certificate /path/to/cert.pem;
    ssl_certificate_key /path/to/key.pem;

    # Proxy to Sockeon (Internal)
    location / {
        proxy_pass http://127.0.0.1:8080;
        proxy_http_version 1.1;

        # WebSocket support
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";

        # Forward headers
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;

        # WebSocket timeouts
        proxy_connect_timeout 7d;
        proxy_send_timeout 7d;
        proxy_read_timeout 7d;
    }
}
```

**Important Notes:**

- The frontend JavaScript automatically detects HTTPS and uses `wss://` protocol
- Sockeon runs on HTTP internally (e.g., `127.0.0.1:8080`)
- Nginx handles SSL termination and proxies to Sockeon
- Web Push notifications require HTTPS in production

For more details, see [Sockeon Reverse Proxy Documentation](https://sockeon.com/v2.0/advanced/reverse-proxy).

🔧 Troubleshooting
-----------------

[](#-troubleshooting)

### Common Issues

[](#common-issues)

1. **Web Push Not Working**

    - Ensure HTTPS is enabled (required for web push in production)
    - Check that VAPID keys are properly configured
    - Verify service worker is registered (check DevTools → Application → Service Workers)
    - Ensure user has granted notification permission
2. **WebSocket Connection Failed**

    - Ensure the Sockeon server is running: `php artisan sockeon:start`
    - Check host and port configuration in `.env`
    - Verify firewall settings
3. **Notifications Not Appearing**

    - Check browser console for errors
    - Verify user is subscribed to web push
    - Check WebSocket connection status

### Debug Mode

[](#debug-mode)

Enable debug mode in your `.env` file:

```
SOCKEON_DEBUG=true
```

🤝 Contributing
--------------

[](#-contributing)

We welcome contributions! Please feel free to submit a Pull Request.

📄 License
---------

[](#-license)

This package is open-sourced software licensed under the [MIT License](LICENSE).

🙏 Acknowledgments
-----------------

[](#-acknowledgments)

- [Filament](https://filamentphp.com/) for the amazing admin panel framework
- [Sockeon](https://sockeon.com) for WebSocket server implementation
- [minishlink/web-push](https://github.com/web-push-libs/web-push-php) for Web Push protocol implementation
- [Laravel](https://laravel.com/) for the robust PHP framework

📞 Support
---------

[](#-support)

- **Documentation**: [GitHub Wiki](https://github.com/xentixar/filament-push-notifications/wiki)
- **Issues**: [GitHub Issues](https://github.com/xentixar/filament-push-notifications/issues)
- **Discussions**: [GitHub Discussions](https://github.com/xentixar/filament-push-notifications/discussions)
- **Email**:

---

**Made with ❤️ by [xentixar](https://github.com/xentixar)**

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance68

Regular maintenance activity

Popularity28

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 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 ~0 days

Total

3

Last Release

252d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/02fcfef53b44a7da91a3d46bfb38adb40f900d8ac85a71788e3bf41fd2237c6f?d=identicon)[xentixar](/maintainers/xentixar)

---

Top Contributors

[![xentixar](https://avatars.githubusercontent.com/u/152050438?v=4)](https://github.com/xentixar "xentixar (21 commits)")

---

Tags

filamentphplaravelphppushpush-notifications

### Embed Badge

![Health badge](/badges/xentixar-filament-push-notifications/health.svg)

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

###  Alternatives

[tijsverkoyen/css-to-inline-styles

CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you're sending emails.

5.8k505.3M227](/packages/tijsverkoyen-css-to-inline-styles)[minishlink/web-push

Web Push library for PHP

1.9k12.0M53](/packages/minishlink-web-push)[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2587.7M12](/packages/laravel-notification-channels-twilio)[spatie/url-signer

Generate a url with an expiration date and signature to prevent unauthorized access

4422.3M16](/packages/spatie-url-signer)[mattketmo/email-checker

Throwaway email detection library

2742.0M5](/packages/mattketmo-email-checker)[eduardokum/laravel-mail-auto-embed

Library for embed images in emails automatically

1702.0M5](/packages/eduardokum-laravel-mail-auto-embed)

PHPackages © 2026

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