PHPackages                             farzin/easy-pusher - 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. farzin/easy-pusher

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

farzin/easy-pusher
==================

A package for sending live push notification with pusher

26PHP

Since Oct 3Pushed 8y agoCompare

[ Source](https://github.com/farzinft/easy-pusher)[ Packagist](https://packagist.org/packages/farzin/easy-pusher)[ RSS](/packages/farzin-easy-pusher/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (4)Used By (0)

Easy Pusher
===========

[](#easy-pusher)

Now It's not hard to broadcast events through public or private channels, you can send notify to specific or collection of users,

### Installation

[](#installation)

- `composer require "farzin/easy-pusher":"dev-master"`

### Add Service Providers

[](#add-service-providers)

- `Vinkla\Pusher\PusherServiceProvider::class`
- `Farzin\EasyPusher\EasyPusherServiceProvider::class`

### Add Facade

[](#add-facade)

```
'EasyPusher' => Farzin\EasyPusher\EasyPusherFacade::class

```

### JS Guide:

[](#js-guide)

first you need add pusher.js to your html file ``

```
//For Private Channels:

 window.userId = '{{ auth()->check() ? auth()->user()->id : null}}';
    Pusher.logToConsole = true;
    var pusherPrivate = new Pusher('YOUR PUSHER KEY', {
        authEndpoint: '/easy-pusher/auth',
        auth: {
            headers: {
                'X-CSRF-TOKEN': '{{ csrf_token() }}'
            }
        },
        cluster: 'us2',
        encrypted: true
    });
    var pusherPublic = new Pusher('YOUR PUSHER KEY', {
        cluster: 'us2',
        encrypted: true
    });
    var channels = {!! json_encode(config('easy-pusher.channels')) !!};
    for(var i = 0; i < channels.length; i++) {
        var channel = channels[i];
        if (channel.match(/^(private).*/)) {
            pusherPrivate.subscribe(channel + '.' + window.userId);
        } else {
            pusherPublic.subscribe(channel);
        }
	}
    pusherPublic.bind('sample-event', function () {
		alert();
    })

```

### Back End Guide:

[](#back-end-guide)

first you need publish config file: `php artisan vendor:publish`then in easy-pusher.php config file your need to define your channels, for private channels prefix with 'private';

```
return [
    'channels' => [
        'private-sample-channel', //prefix with public or private
        'public-sample-channel'
    ]
];

```

for broadcasting events

```
use EasyPusher;

//broadcast event to public channels
EasyPusher::withEvent('sample-event')->withData(array $data)->send();

//for private channels

//collection of users
EasyPusher::withEvent('sample-event')->toUsers(Collection $users)->withData(array $data)->send();

//specific user | user Model
EasyPusher::withEvent('sample-event')->toUser($user)->withData(array $data)->send();

```

you can pass event name as string or qualified class name.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/7bd93b593dba197ea128bba25fe750f90163d3a6fd2775be66d0828342fe5f14?d=identicon)[farzinft](/maintainers/farzinft)

### Embed Badge

![Health badge](/badges/farzin-easy-pusher/health.svg)

```
[![Health](https://phpackages.com/badges/farzin-easy-pusher/health.svg)](https://phpackages.com/packages/farzin-easy-pusher)
```

###  Alternatives

[tijsverkoyen/css-to-inline-styles

CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you're sending emails.

5.8k505.3M227](/packages/tijsverkoyen-css-to-inline-styles)[minishlink/web-push

Web Push library for PHP

1.9k12.0M53](/packages/minishlink-web-push)[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2587.7M12](/packages/laravel-notification-channels-twilio)[spatie/url-signer

Generate a url with an expiration date and signature to prevent unauthorized access

4422.3M16](/packages/spatie-url-signer)[mattketmo/email-checker

Throwaway email detection library

2742.0M5](/packages/mattketmo-email-checker)[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)

PHPackages © 2026

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