PHPackages                             sarfraznawaz2005/laravel-sse - 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. [Mail &amp; Notifications](/categories/mail)
4. /
5. sarfraznawaz2005/laravel-sse

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

sarfraznawaz2005/laravel-sse
============================

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

3.0.0(4mo ago)474.6k↓33.3%14[1 issues](https://github.com/sarfraznawaz2005/laravel-sse/issues)MITPHPPHP ^7.0|^8.0

Since Aug 10Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/sarfraznawaz2005/laravel-sse)[ Packagist](https://packagist.org/packages/sarfraznawaz2005/laravel-sse)[ Docs](https://github.com/sarfraznawaz2005/laravel-sse)[ RSS](/packages/sarfraznawaz2005-laravel-sse/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (1)Versions (18)Used By (0)

[![Latest Version on Packagist](https://camo.githubusercontent.com/0b31284780a7f17d16a6b9b5d4866a43a938d92c5d66a82f0eee0f87b37b74e3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7361726672617a6e6177617a323030352f6c61726176656c2d7373652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sarfraznawaz2005/laravel-sse)[![Total Downloads](https://camo.githubusercontent.com/e487629ea998fa46b67fe3cdc4d35b784cadc6ebc0ba65baf9d8ba8be4d6cb79/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7361726672617a6e6177617a323030352f6c61726176656c2d7373652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sarfraznawaz2005/laravel-sse)

Laravel SSE
===========

[](#laravel-sse)

Laravel package to provide Server Sent Events functionality for your app. You can use this package to show instant notifications to your users without them having to refresh their pages.

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

[](#requirements)

- PHP &gt;= 7
- Laravel 5

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

[](#installation)

Via Composer

```
$ composer require sarfraznawaz2005/laravel-sse
```

For Laravel &lt; 5.5:

Add Service Provider to `config/app.php` in `providers` section

```
Sarfraznawaz2005\SSE\ServiceProvider::class,
```

Add Facade to `config/app.php` in `aliases` section

```
'SSE' => Sarfraznawaz2005\SSE\Facades\SSEFacade::class,
```

---

Publish package's config, migration and view files by running below command:

```
$ php artisan vendor:publish --provider="Sarfraznawaz2005\SSE\ServiceProvider"
```

Run `php artisan migrate` to create `sselogs` table.

Setup SSE
---------

[](#setup-sse)

Setup config options in `config/sse.php` file and then add this in your view/layout file:

```
@include('sse::view')
```

Usage
-----

[](#usage)

Syntax:

```
/**
 * @param string $message : notification message
 * @param string $type : alert, success, error, warning, info
 * @param string $event : Type of event such as "EmailSent", "UserLoggedIn", etc
 */
SSEFacade::notify($message, $type = 'info', $event = 'message')
```

To show popup notifications on the screen, in your controllers/event classes, you can do:

```
use Sarfraznawaz2005\SSE\Facades\SSEFacade;

public function myMethod()
{
    SSEFacade::notify('hello world....');

    // or via helper
    sse_notify('hi there');
}
```

Customizing Notification Library
--------------------------------

[](#customizing-notification-library)

By default, package uses [noty](https://github.com/needim/noty) for showing notifications. You can customize this by modifying code in `resources/views/vendor/sse/view.blade.php` file.

Customizing SSE Events
----------------------

[](#customizing-sse-events)

By default, pacakge uses `message` event type for streaming response:

```
SSEFacade::notify($message, $type = 'info', $event = 'message')
```

Notice `$event = 'message'`. You can customize this, let's say you want to use `UserLoggedIn` as SSE event type:

```
use Sarfraznawaz2005\SSE\Facades\SSEFacade;

public function myMethod()
{
    SSEFacade::notify('hello world....', 'info', 'UserLoggedIn');

    // or via helper
    sse_notify('hi there', 'info', 'UserLoggedIn');
}
```

Then you need to handle this in your view yourself like this:

```

var es = new EventSource("{{route('__sse_stream__')}}");

es.addEventListener("UserLoggedIn", function (e) {
    var data = JSON.parse(e.data);
    alert(data.message);
}, false);

```

Credits
-------

[](#credits)

- [Sarfraz Ahmed](https://github.com/sarfraznawaz2005)
- [All Contributors](https://github.com/sarfraznawaz2005/laravel-sse/graphs/contributors)

License
-------

[](#license)

Please see the [license file](license.md) for more information.

###  Health Score

53

—

FairBetter than 97% of packages

Maintenance74

Regular maintenance activity

Popularity35

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 83.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~146 days

Recently: every ~313 days

Total

17

Last Release

141d ago

Major Versions

1.1.2 → 2.0.02022-07-26

2.3.0 → 3.0.02025-12-29

PHP version history (2 changes)1.0.0PHP ^7.0

2.1.0PHP ^7.0|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/3f9bbcf3a6cda5f8bdf9afe10c20f5c6f563fc1a4d628a9af25c5fdec3f9c216?d=identicon)[sarfraznawaz2005](/maintainers/sarfraznawaz2005)

---

Top Contributors

[![sarfraznawaz2005](https://avatars.githubusercontent.com/u/201788?v=4)](https://github.com/sarfraznawaz2005 "sarfraznawaz2005 (20 commits)")[![sarfrazonsupport](https://avatars.githubusercontent.com/u/142378572?v=4)](https://github.com/sarfrazonsupport "sarfrazonsupport (2 commits)")[![rompetomp](https://avatars.githubusercontent.com/u/1550749?v=4)](https://github.com/rompetomp "rompetomp (1 commits)")[![Serveronet](https://avatars.githubusercontent.com/u/123076893?v=4)](https://github.com/Serveronet "Serveronet (1 commits)")

---

Tags

eventslaravellaravel-packagenotificationspollingrealtimeserversenteventssseeventlaravelservernotificationssserealtimepollingSever Sent Events

### Embed Badge

![Health badge](/badges/sarfraznawaz2005-laravel-sse/health.svg)

```
[![Health](https://phpackages.com/badges/sarfraznawaz2005-laravel-sse/health.svg)](https://phpackages.com/packages/sarfraznawaz2005-laravel-sse)
```

###  Alternatives

[edvinaskrucas/notification

Package for Laravel for helping to manage flash / instant notifications / messages.

520393.9k10](/packages/edvinaskrucas-notification)[usamamuneerchaudhary/filament-notifier

A powerful notification system for FilamentPHP that handles multi-channel notifications with template management, scheduling, and real-time delivery. Built for developers who need enterprise-grade notifications without the complexity.

321.1k](/packages/usamamuneerchaudhary-filament-notifier)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
