ack/notification-bundle
Symfony bundle providing a Redis + Node.js (socket.io) pub/sub notification architecture. Render notifications via Twig, publish to specific user IDs or everyone, track online users in Redis, and push real-time “notification” events to connected clients.
symfony/http-foundation, symfony/dependency-injection). Requires abstraction layer for Laravel’s service container.twig/twig or a custom adapter.ack.notifier as a Laravel service.twig/twig in Laravel (overhead).beyondcode/laravel-websockets) or kept as-is if Node.js is already in the stack.predis/predis or phpredis).database:table) suffice?| Component | Current (Symfony) | Laravel Adaptation | Notes |
|---|---|---|---|
| Service Container | Symfony DI | Laravel Service Provider (register(), boot()) |
Use Symfony\Component\DependencyInjection bridge. |
| Templating | Twig | Blade → Twig (via twig/twig) or custom adapter |
Pre-render Blade to strings for Pub/Sub. |
| Pub/Sub | Redis | Redis (same) | Laravel supports predis/predis. |
| Real-Time Client | Socket.IO (Node.js) | Laravel Echo (Pusher/Ably) or Raw WebSockets | Replace server.js with Laravel’s stack. |
| Event Dispatching | Symfony Events | Laravel Events (event(new NotificationEvent())) |
Bridge via symfony/event-dispatcher. |
$this->app->singleton('ack.notifier', function ($app) {
return new AckNotifier(
$app['redis'], // Laravel Redis client
new TwigAdapter($app['blade']) // Bridge Blade/Twig
);
});
twig/twig in Laravel (adds ~5MB).$content = Blade::render('emails.notification', ['data' => $params]);
$this->ackNotifier->notify($content, [$userId]);
server.js with Laravel Echo (Pusher/Ably) or raw WebSockets (Ratchet).import Echo from 'laravel-echo';
window.Pusher = require('pusher-js');
window.Echo = new Echo({
broadcaster: 'pusher',
key: 'APP_PUSHER_KEY',
});
Echo.channel('notifications.user.1')
.listen('NotificationEvent', (data) => { ... });
redis config works with predis/phpredis).symfony/dependency-injection, symfony/event-dispatcher) via Composer.notify() calls with hardcoded messages.INFO memory).PUBSUB CHANNELS).| Failure Point | Impact | Mitigation | |-------------------------|
How can I help you explore Laravel packages today?