Download the PHP package meita/realtime-notifications without Composer
On this page you can find all versions of the php package meita/realtime-notifications. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package realtime-notifications
meita/realtime-notifications
Author: Mohamed A. Eita ([email protected])
File-backed, reliable realtime notifications over Server-Sent Events (SSE). Notifications are stored per user_id as JSON/TXT under storage, moved to inflight/ when streamed, and deleted after ACK.
Works standalone in pure PHP or plugged into Laravel (10/11/12). Comes with a Laravel bridge (routes + provider) and a plain PHP adapter.
Features
- SSE push (
event: meita.notification) with auto ACK support - Storage as files: JSON (structured) or TXT (plain)
- Per user folders:
meita/notifications/{pending|inflight}/{userId}/... - Keyword filtering for JSON (
?keywords=order,urgent) - Lease handling: pending → inflight until ACK; reclaim stale inflight files
- Auth via signed token (or Laravel auth/session when using the bridge)
Requirements
- PHP
^8.1 - Optional Laravel bridge: Laravel
^10|^11|^12
Install
For a local path repo (adjust the path as needed):
Storage layout
Flow: push → pending → stream moves to inflight → ACK deletes.
Usage with Laravel
1) Install the package (auto-discovery registers the provider and facade). 2) Optional publish:
Push from PHP
Generate a token (for SSE/ACK)
Endpoints (provided by the bridge)
- Stream (SSE):
GET /api/meita/notifications/stream/{userId}?meita_token=... - ACK:
POST /api/meita/notifications/ack/{userId}?meita_token=...
Browser (vanilla JS)
Using the shipped JS client
Usage in pure PHP (or any framework)
Use the core manager with the local filesystem adapter:
Build your own HTTP endpoints (any framework) mirroring the Laravel controllers:
- SSE stream: emit
event: meita.notificationwith JSON payload fromreserveNext(...), move file to inflight,flush(), heartbeat: ping. - ACK: delete by
fileoridusing$manager->store()->ackMany(...).
Configuration (ENV for Laravel bridge)
Tests
Tests are under tests/Feature/MeitaRealtimeNotificationsTest.php.
License
MIT
All versions of realtime-notifications with dependencies
illuminate/contracts Version ^10.0|^11.0|^12.0
illuminate/http Version ^10.0|^11.0|^12.0
illuminate/routing Version ^10.0|^11.0|^12.0
illuminate/support Version ^10.0|^11.0|^12.0