PHPackages                             andreshg112/pusher-api-notifications - 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. andreshg112/pusher-api-notifications

AbandonedArchivedLibrary

andreshg112/pusher-api-notifications
====================================

Send Pusher API Notifications

1.2.0(2y ago)174331MITPHPPHP &gt;=7.1.0

Since Mar 19Pushed 2y ago2 watchersCompare

[ Source](https://github.com/andreshg112/pusher-api-notifications)[ Packagist](https://packagist.org/packages/andreshg112/pusher-api-notifications)[ Docs](https://github.com/andreshg112/pusher-api-notifications)[ RSS](/packages/andreshg112-pusher-api-notifications/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (3)Dependencies (6)Versions (5)Used By (0)

Pusher API Notifications
========================

[](#pusher-api-notifications)

[![Latest Version on Packagist](https://camo.githubusercontent.com/215914dd1951e3829434aaf3380bb2b62635eb128791743ba9416406db0c734e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616e6472657368673131322f7075736865722d6170692d6e6f74696669636174696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/andreshg112/pusher-api-notifications)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/0ba3729c8f7bd5ded688095fc4fc7e61d2aa167347e1edffb08d087d40fc8212/68747470733a2f2f7472617669732d63692e636f6d2f616e6472657368673131322f7075736865722d6170692d6e6f74696669636174696f6e732e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/andreshg112/pusher-api-notifications)[![StyleCI](https://camo.githubusercontent.com/2354cf0f9167042cb5203fc5fb994760e341951eb5e4572736ff667b36897b16/68747470733a2f2f7374796c6563692e696f2f7265706f732f3137353939373430362f736869656c64)](https://styleci.io/repos/175997406)[![Quality Score](https://camo.githubusercontent.com/8ad38230194e14888b86ceaeebfb5cd311943cd8030efd7d8f1ebeee55d987a2/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f616e6472657368673131322f7075736865722d6170692d6e6f74696669636174696f6e732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/andreshg112/pusher-api-notifications)[![Code Coverage](https://camo.githubusercontent.com/7796495b8468cd6fd7f5bc5f45e161522e95caffde6514b486e63aa76776456f/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f616e6472657368673131322f7075736865722d6170692d6e6f74696669636174696f6e732f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/andreshg112/pusher-api-notifications/?branch=master)[![Total Downloads](https://camo.githubusercontent.com/b9d430dfc64e2ba524a0f3b1612cfe26a8b9fcd2224c2cee687cf8b2035463ff/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616e6472657368673131322f7075736865722d6170692d6e6f74696669636174696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/andreshg112/pusher-api-notifications)

This package makes it easy to send notifications using [Pusher API Messages](https://pusher.com/docs/javascript_quick_start) (like shown below) with Laravel 5.3 or greater.

[![](https://user-images.githubusercontent.com/15859884/54795945-22e8fb00-4c1c-11e9-9606-aa573103d919.png)](https://user-images.githubusercontent.com/15859884/54795945-22e8fb00-4c1c-11e9-9606-aa573103d919.png)

Contents
--------

[](#contents)

- [Installation](#installation) - [Setting up the Pusher API Notifications service](#setting-up-the-Pusher-API-Notifications-service)
- [Usage](#usage) - [Available Message methods](#available-message-methods)
- [Changelog](#changelog)
- [Testing](#testing)
- [Security](#security)
- [Contributing](#contributing)
- [Credits](#credits)
- [License](#license)

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

[](#installation)

Require the package:

```
$ composer require andreshg112/pusher-api-notifications
```

### Setting up the Pusher API Notifications service

[](#setting-up-the-pusher-api-notifications-service)

This package requires [pusher/pusher-http-laravel ^4.2](https://github.com/pusher/pusher-http-laravel), so after installing this, you have to [configure it](https://github.com/pusher/pusher-http-laravel#configuration).

> If your using Laravel ^5.5, don't worry about adding the service provider to your `config/app.php` file because this package uses [Laravel Package Discovery](https://laravel.com/docs/5.8/packages#package-discovery). If don't, you have to add it:

```
'providers' => [
    // ...,
    Andreshg112\PusherApiNotifications\PusherApiServiceProvider::class,
],
```

Usage
-----

[](#usage)

> This is a third-party Laravel Notification Package, so you should know how to use Notifications in Laravel before using this. Docs can be found here: .

In your notification, add the `PusherApiChannel` to the `via()` function:

```
use Andreshg112\PusherApiNotifications\PusherApiChannel;

public function via($notifiable)
{
    return [PusherApiChannel::class];
}
```

Then, create a method called `toApiNotification()` in your notification:

```
use Andreshg112\PusherApiNotifications\PusherApiMessage;

public function toApiNotification($notifiable)
{
    return (new PusherApiMessage)
        ->channels($channelName)
        ->event($eventName)
        ->data($data)
        ->socketId($socketId)
        ->debug($debug)
        ->alreadyEncoded($alreadyEncoded);

    // or

    return new PusherApiMessage($channelName, $eventName, $data, $socketId, $debug, $alreadyEncoded);
}
```

### Available Message methods

[](#available-message-methods)

- `channels($channelName)`: array or string of channel name(s).
- `event($eventName)`: the name of the event for the Pusher message.
- `data($data)`: array, string or something that can be corverted to JSON. It's the body of the Pusher message.
- `socketId($socketId)`: \[optional\] socketId of Pusher.
- `debug($debug)`: \[optional\] boolean that tells Pusher if you're debugging.
- `alreadyEncoded($alreadyEncoded)`: \[optional\] If the data is already encoded and you don't want Pusher to convert it, set this to true.

These parameters are the same received by [`Pusher::trigger()`](https://github.com/pusher/pusher-http-laravel#examples) method.

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Andrés Herrera García](https://github.com/andreshg112)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~825 days

Total

3

Last Release

960d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5035725cb99badcda1bac670e2ec5808d31ff98c9144e278fbff399fed1bb594?d=identicon)[andreshg112](/maintainers/andreshg112)

---

Top Contributors

[![andreshg112](https://avatars.githubusercontent.com/u/15859884?v=4)](https://github.com/andreshg112 "andreshg112 (26 commits)")

---

Tags

laravellaravel-notification-channelsphppusherpusher-apilaravelnotificationspusherpusher-api-notifications

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/andreshg112-pusher-api-notifications/health.svg)

```
[![Health](https://phpackages.com/badges/andreshg112-pusher-api-notifications/health.svg)](https://phpackages.com/packages/andreshg112-pusher-api-notifications)
```

###  Alternatives

[laravel/slack-notification-channel

Slack Notification Channel for laravel.

89069.7M111](/packages/laravel-slack-notification-channel)[laravel-notification-channels/pusher-push-notifications

Pusher native Push Notifications driver.

282733.2k1](/packages/laravel-notification-channels-pusher-push-notifications)

PHPackages © 2026

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