PHPackages                             brybry/laravel-notify - 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. brybry/laravel-notify

ActiveLibrary

brybry/laravel-notify
=====================

A Laravel package for real-time notifications, events, and chat functionality using self-hosted WebSocket server

00PHP

Since Sep 17Pushed 7mo agoCompare

[ Source](https://github.com/rondinabrybry/laravel-notifly)[ Packagist](https://packagist.org/packages/brybry/laravel-notify)[ RSS](/packages/brybry-laravel-notify/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Notify
==============

[](#laravel-notify)

A Laravel package that enables real-time notifications, events, and chat functionality using a self-hosted WebSocket server. No external services like Pusher required!

Features
--------

[](#features)

- 🚀 **Self-hosted WebSocket server** using PHP Ratchet
- 🔐 **JWT Authentication** support
- 📡 **Laravel Broadcasting** integration
- 🎯 **Private &amp; Public channels**
- 🔄 **Auto-reconnection** with exponential backoff
- 📱 **Responsive Blade components**
- ⚡ **Standalone JavaScript client**
- 🛡️ **CORS support**
- 📊 **Connection statistics**
- 🎨 **Easy to extend** for chat, dashboards, and alerts

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

[](#requirements)

- PHP 8.1+
- Laravel 9.0+
- ext-sockets (for WebSocket server)
- ext-pcntl (optional, for daemon mode)

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

[](#installation)

### 1. Install the package

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

```
composer require your-vendor/laravel-notify
```

### 2. Publish configuration

[](#2-publish-configuration)

```
php artisan vendor:publish --provider="LaravelNotify\LaravelNotifyServiceProvider" --tag="config"
```

### 3. Publish assets (optional)

[](#3-publish-assets-optional)

```
# Publish JavaScript client
php artisan vendor:publish --provider="LaravelNotify\LaravelNotifyServiceProvider" --tag="js"

# Publish Blade views
php artisan vendor:publish --provider="LaravelNotify\LaravelNotifyServiceProvider" --tag="views"
```

### 4. Configure broadcasting

[](#4-configure-broadcasting)

Add the WebSocket broadcaster to your `config/broadcasting.php`:

```
'connections' => [
    'websocket' => [
        'driver' => 'websocket',
    ],
    // ... other connections
],
```

Set your default broadcast driver in `.env`:

```
BROADCAST_DRIVER=websocket
```

### 5. Configure WebSocket server

[](#5-configure-websocket-server)

Update your `.env` file:

```
# WebSocket Server Configuration
WEBSOCKET_HOST=0.0.0.0
WEBSOCKET_PORT=8080
WEBSOCKET_AUTH_ENABLED=true
WEBSOCKET_SECRET=your-app-key

# SSL Configuration (optional)
WEBSOCKET_SSL_ENABLED=false
WEBSOCKET_SSL_CERT=/path/to/cert.pem
WEBSOCKET_SSL_KEY=/path/to/key.pem

# Logging
WEBSOCKET_LOGGING=true
WEBSOCKET_LOG_LEVEL=info
```

Usage
-----

[](#usage)

### Starting the WebSocket Server

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

```
# Start in foreground
php artisan websocket:start

# Start in daemon mode (Linux/Mac only)
php artisan websocket:start --daemon
```

### Broadcasting Events

[](#broadcasting-events)

Create a broadcastable event:

```
