Download the PHP package marcusvbda/filament-realtime-driver without Composer

On this page you can find all versions of the php package marcusvbda/filament-realtime-driver. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package filament-realtime-driver

Filament Realtime Driver

Realtime updates for Filament panels, backed by Laravel Reverb (or any Pusher-protocol-compatible broadcaster), without Laravel Echo or pusher-js on the frontend.

It replaces wire:poll / database-notification polling with actual WebSocket pushes:


Requirements

If you haven't set up broadcasting yet:

This publishes config/reverb.php, adds REVERB_* / VITE_REVERB_* variables to .env, and sets BROADCAST_CONNECTION=reverb. Run the server locally with:

(or add it to your composer.json dev script via Laravel's DevCommands::artisan('reverb:start', 'reverb'), so composer dev starts it alongside everything else).

Installation

Not published to Packagist yet — install as a local path package. In your app's root composer.json:

The service provider is auto-discovered — nothing else to register.

Optionally publish the config file:

Configuration

config/filament-realtime-driver.php:

Key Env var Default Purpose
server FILAMENT_REALTIME_SERVER localhost:8080 host:port of the Reverb server the browser connects to
channel FILAMENT_REALTIME_CHANNEL filament-realtime-driver Default channel the backend listener (connectAndListen()) auto-subscribes to
key REVERB_APP_KEY — Reverb app key, required in the WebSocket connection path
secure FILAMENT_REALTIME_SECURE derived from REVERB_SCHEME Whether the browser connects over wss:// instead of ws://

key reuses your existing REVERB_APP_KEY by default — there is normally nothing to configure beyond what reverb:install already set up.

Quick start

Register the plugin on a panel and call ->socket():

->socket() alone doesn't change anything visible — it just makes the shared browser client available on that panel. You opt into individual features (tables, database notifications, or your own <x-filament-realtime-driver::listener> usage) separately, as shown below.

How it works

Usage

1. Frontend — the <x-filament-realtime-driver::listener> component

Drop it anywhere in a Blade view (inside or outside a Filament panel — it works on any page, it doesn't require Livewire):

Props:

Prop Required Description
channel yes Channel name. Prefix with private- or presence- for protected channels.
event yes Event name — matches whatever broadcastAs() returns on the PHP side.
callback no Raw JS, evaluated every time an event arrives, alongside updating the reactive event variable used above.

Inside the slot, event is an Alpine-reactive object holding whatever broadcastWith() sent — bind to it with x-text, x-show, etc.

To just trigger a Livewire refresh instead of reading the payload, skip the slot and use callback:

2. Filament Tables — Table::socket()

Adds a socket() method directly to Filament\Tables\Table (registered as a macro — Filament's Table is already Macroable, so this is a non-invasive extension, not a parallel implementation). Use it as an alternative to ->poll(...):

Behaviour:

Fire the matching event from wherever the record changes — typically a model event:

Segmenting a channel per user (or tenant, or anything else): parametrize the channel name with whatever identifier should scope who receives the update. This project's JobsTable does it per acting user:

Be precise about what this achieves: the browser subscribes to jobs_{theViewer'sOwnId}, and the dispatch broadcasts to jobs_{theEditor'sId} — so with Auth::id() on both sides, a user only sees a live refresh for edits they themselves triggered (useful for "your own action confirmed" UX, e.g. across two open tabs). If the goal is instead "everyone looking at this list sees every change", scope the channel by something shared by all viewers instead — e.g. 'jobs_' . $job->company_id — and have every viewer's table subscribe to that same channel.

This is a public channel either way (no private- prefix): it only filters which browser tabs get the push, it is not an authorization boundary — anyone who knows or guesses the channel name can subscribe to it. See Channel types below if you need an actual access check.

3. Backend — a persistent PHP listener

For server-side reactions to realtime events (independent of any browser), configure a callback when calling ->socket():

Run it with the bundled Artisan command — this is a long-lived, blocking process, not something you call from an HTTP request:

Wire it into composer dev the same way you would reverb:start or a queue worker (in AppServiceProvider::boot()):

If ->socket() is called with no callback (as in the quick-start example), the command connects, finds nothing to watch, and exits immediately — it's a no-op, not an error. Backend listening is entirely optional and independent of frontend usage.

4. Database notifications

Replaces Filament's own database-notifications polling with a push, using the broadcast event Filament already ships (Filament\Notifications\Events\DatabaseNotificationsSent) — this package doesn't reimplement or duplicate the notifications UI at all.

Two things to know:

  1. The panel itself must also enable database notifications — that's Filament's own toggle for the bell UI, unrelated to this package:

    This plugin only changes how that UI gets its updates, not whether it exists.

  2. Send notifications with isEventDispatched: true, or nothing gets broadcast:

What ->databaseNotifications() actually does:

That last point matters: Filament's own component only starts listening for realtime updates on its own once it has rendered at least one existing notification (a quirk in database-notifications.blade.php, not something this package can fix upstream). The bridge above works around it, so even a user's very first notification arrives live instead of needing a page reload.

The notifications table must exist (php artisan make:notifications-table && php artisan migrate if you haven't already), and on PostgreSQL, its data column must be json, not the framework's default text — Filament queries it with data->>'format', which Postgres's text type doesn't support.

Generic broadcasting — RealtimeEvent

Instead of writing a dedicated Event class for every notification, dispatch this ready-made one directly with a channel, event name and payload:

It implements ShouldBroadcastNow (broadcasts immediately, no queue worker required). Write your own Event class instead if you need queued broadcasting, or richer payload logic than "here's an array".

Channel types and authorization

This package talks the Pusher wire protocol directly (the same protocol Reverb speaks) instead of using Laravel Echo / pusher-js. It never installs or requires those packages — the shim in How it works exists purely so Filament's own code (which does expect a real window.Echo) keeps working.

Either way, you still need routes/channels.php authorization rules for private/presence channels — this package doesn't add or replace that, it's plain Laravel broadcasting:

Public channels (like the orders / jobs_{id} examples earlier in this README) need no entry in channels.php at all — Reverb accepts a subscription to any public channel name without asking Laravel.

Activating, configuring, segmenting — summary

Known limitations

License

MIT.


All versions of filament-realtime-driver with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4.1
filament/filament Version ^5.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package marcusvbda/filament-realtime-driver contains the following files

Loading the files please wait ...