Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Sse

Laravel Sse Laravel Package

sarfraznawaz2005/laravel-sse

A lightweight Laravel package for Server-Sent Events (SSE) that lets you stream real-time updates from your app to the browser without WebSockets, using a simple API for sending events and keeping connections alive.

View on GitHub
Deep Wiki
Context7

Laravel package to provide Server Sent Events functionality for your app.

Frequently asked questions about Laravel Sse
How do I install sarfraznawaz2005/laravel-sse?
Run composer require sarfraznawaz2005/laravel-sse; Laravel package auto-discovery registers the service provider, so there are no migrations or queue workers to configure. You then add a route that returns the package's streaming response. Check the README for the tag you install to see whether a config file needs publishing.
Which Laravel and PHP versions does laravel-sse support?
Version 3.0.0 raises the illuminate/support constraint to Laravel 12, while 2.3.0 is the line for earlier releases such as Laravel 10 and 11. Because the major bump was constraint-only, always read composer.json on the exact tag you intend to install. Confirm the PHP floor there matches your runtime images before upgrading.
How do I stream Server-Sent Events from a Laravel controller with this package?
Define a route and return the package's SSE streaming response from a controller, calling its event method inside a loop with an event name and data payload, then flushing output. Each open stream occupies one PHP worker, so keep loops bounded and break out when the client disconnects. Avoid heavy work inside the loop; read precomputed state instead.
Do I need WebSockets or Pusher to use laravel-sse?
No. SSE is a one-way HTTP channel, and this package uses a long-lived streaming response instead of a WebSocket connection. There is no broker, no channel authentication layer, and no client-to-server messaging. If you need bidirectional traffic or fan-out to many subscribers, use Laravel broadcasting with Pusher or Reverb instead.
How does laravel-sse keep the SSE connection alive?
Packages like this typically emit periodic keepalive comments or ping events so proxies and browsers do not close an idle stream; confirm the exact method name in the README for your version. Keepalives only help if the environment cooperates, so also disable proxy buffering and raise idle timeouts on your load balancer. Test with a stream that stays open for several minutes.
Does laravel-sse work with Laravel Octane or Swoole?
This is not clearly documented, and Octane changes the assumptions SSE relies on because workers persist between requests and a long-lived stream can tie one up. Test in a staging Octane environment with concurrent users before committing to it in production. If you hit problems, run the SSE endpoint on a conventional PHP-FPM pool instead.
Why are my Server-Sent Events buffered or delayed behind nginx or PHP-FPM?
Delayed delivery is almost always environmental: nginx proxy buffering, gzip compression, CDN buffering, or PHP output buffering holding the response until it completes. Disable buffering for the SSE route, send an initial padding comment so headers flush, and call flush after each event. Also check API gateway or load balancer idle timeouts, which are commonly set to 30 or 60 seconds.
Can I use laravel-sse for queue job progress or notification badges?
Yes, fire-and-forget status streaming is the sweet spot: background job progress, import status, log tailing, notification badges, and dashboard refresh. Write progress to cache or a status table from the job, then have the stream loop poll that lightweight source. Do not hold a database transaction open while streaming, and always give the loop a maximum duration.
Does laravel-sse handle client reconnects and Last-Event-ID?
Reconnection is mostly handled by the browser's EventSource API, which retries automatically after a dropped connection. Whether Last-Event-ID resumption with replay is implemented depends on the package version, so verify before relying on it. If you need guaranteed delivery, store an incrementing event id and replay missed entries from cache on reconnect.
What changed in laravel-sse 3.0.0 and should I upgrade from 2.3.0?
The only documented change in 3.0.0 is raising the illuminate/support constraint to Laravel 12, so treat it as a framework upgrade gate rather than a package upgrade. Diff the 2.3.0 and 3.0.0 tags to confirm nothing but composer.json moved, since a constraint-only major bump means semver cannot be assumed either way. Pin 2.3.0 on Laravel 10 and 11 services and adopt 3.0.0 only when that service moves to Laravel 12, recording single-maintainer risk as a known vendor concern.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core