PHPackages                             laravel-notification-channels/pusher-push-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. laravel-notification-channels/pusher-push-notifications

ActiveLibrary

laravel-notification-channels/pusher-push-notifications
=======================================================

Pusher native Push Notifications driver.

4.4.0(1mo ago)282733.2k↓11.2%70[2 PRs](https://github.com/laravel-notification-channels/pusher-push-notifications/pulls)1MITPHPPHP &gt;=8.0

Since Aug 10Pushed 9mo ago11 watchersCompare

[ Source](https://github.com/laravel-notification-channels/pusher-push-notifications)[ Packagist](https://packagist.org/packages/laravel-notification-channels/pusher-push-notifications)[ Docs](https://github.com/LaravelNotificationChannels/pusher-push-notifications)[ RSS](/packages/laravel-notification-channels-pusher-push-notifications/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (14)Versions (23)Used By (1)

Pusher Beams push notifications channel for Laravel 8.x &amp; 9.x
=================================================================

[](#pusher-beams-push-notifications-channel-for-laravel-8x--9x)

[![Latest Version on Packagist](https://camo.githubusercontent.com/4ef519189c5fb7adbcd6761543582728e7b3399fc1197054933021546efb3fb0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f7075736865722d707573682d6e6f74696669636174696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laravel-notification-channels/pusher-push-notifications)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/e3d8d5bc5a0d471bd316a65cfe562a463e03534a7efdbd8e4ec01e5b75c8936b/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f7075736865722d707573682d6e6f74696669636174696f6e732f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/laravel-notification-channels/pusher-push-notifications)[![StyleCI](https://camo.githubusercontent.com/5aa508ba52e7eef928bd37347e405de61819fed2055ea4391529980b2f2f0211/68747470733a2f2f7374796c6563692e696f2f7265706f732f36353337393332312f736869656c64)](https://styleci.io/repos/65379321)[![SensioLabsInsight](https://camo.githubusercontent.com/cc88870747ad11c0f3b0a6d4efcde14e8d74df772b765e80d8a624cd11836395/68747470733a2f2f696d672e736869656c64732e696f2f73656e73696f6c6162732f692f39303135363931662d313330642d346663612d383731302d3732613031306162633638342e7376673f7374796c653d666c61742d737175617265)](https://insight.sensiolabs.com/projects/9015691f-130d-4fca-8710-72a010abc684)[![Quality Score](https://camo.githubusercontent.com/565f2b806d86414aa052ca69cb92f5568aab03e32f69439ca895ae8f304c910d/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f7075736865722d707573682d6e6f74696669636174696f6e732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/laravel-notification-channels/pusher-push-notifications)[![Code Coverage](https://camo.githubusercontent.com/0f855731dce53afe4900795c73ab5aeaea06f5641bdba010d65117256d40b44b/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f7075736865722d707573682d6e6f74696669636174696f6e732f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/laravel-notification-channels/pusher-push-notifications/?branch=master)[![Total Downloads](https://camo.githubusercontent.com/f9db973574e62aa906809f54cd62690829f025681a29e798081b4d805aae1978/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f7075736865722d707573682d6e6f74696669636174696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laravel-notification-channels/pusher-push-notifications)

This package makes it easy to send [Pusher Beams push notifications](https://pusher.com/docs/beams) with Laravel.

Please note that this notification channel should not be confused with Pusher Channels.

Also please note that prior to version 2.0, this package integrated with Pusher's beta push notifications service that was part of Pusher Channels. Please see Pusher's [migration guide](https://www.pusher.com/docs/channels/push_notifications/migration-guide) for more information.

Contents
--------

[](#contents)

- [Pusher Beams push notifications channel for Laravel 8.x &amp; 9.x](#pusher-beams-push-notifications-channel-for-laravel-55-6x-7x--8x)
    - [Contents](#contents)
    - [Installation](#installation)
        - [Setting up your Pusher account](#setting-up-your-pusher-account)
    - [Usage](#usage)
        - [Available Message methods](#available-message-methods)
        - [Sending to multiple platforms](#sending-to-multiple-platforms)
        - [Routing a message](#routing-a-message)
        - [Publish to users](#publish-to-users)
    - [Changelog](#changelog)
    - [Testing](#testing)
    - [Security](#security)
    - [Contributing](#contributing)
    - [Credits](#credits)
    - [License](#license)

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

[](#installation)

You can install the package via composer:

```
composer require laravel-notification-channels/pusher-push-notifications
```

### Setting up your Pusher account

[](#setting-up-your-pusher-account)

Before using this package you should set up a Pusher Beams account. Here are the steps required.

- Login to
- Select the "Beams" product.
- Select your instance from the list or create a new instance.
- Click on the "Settings" tab.
- Upload your APNS Certificate and/or add your FCM Server key.
- Now select the "Keys" tab.
- Copy your `Instance Id`, and `Secret Key`.
- Add a new entry to in your `config/services.php` file: ```
    'pusher' => [
        'beams_instance_id' => 'Your Instance Id',
        'beams_secret_key' => 'Your Secret Key',
    ],
    ```
- You're now good to go.

Usage
-----

[](#usage)

Now you can use the channel in your `via()` method inside the Notification class.

```
use NotificationChannels\PusherPushNotifications\PusherChannel;
use NotificationChannels\PusherPushNotifications\PusherMessage;
use Illuminate\Notifications\Notification;

class AccountApproved extends Notification
{
    public function via($notifiable)
    {
        return [PusherChannel::class];
    }

    public function toPushNotification($notifiable)
    {
        return PusherMessage::create()
            ->iOS()
            ->badge(1)
            ->sound('success')
            ->body("Your {$notifiable->service} account was approved!");
    }
}
```

### Available Message methods

[](#available-message-methods)

- `platform('')`: Accepts a string value of `iOS`, `Android` or `web`.
- `iOS()`: Sets the platform value to iOS.
- `android()`: Sets the platform value to Android.
- `web()`: Sets the platform value to web.
- `link()`: Accepts a string value which will lead to URI specified on notification click.
- `title('')`: Accepts a string value for the title.
- `body('')`: Accepts a string value for the body.
- `sound('')`: Accepts a string value for the notification sound file. Notice that if you leave blank the default sound value will be `default`.
- `icon('')`: Accepts a string value for the icon file. (Android Only)
- `badge(1)`: Accepts an integer value for the badge. (iOS Only)
- `setOption($key, $value)`: Allows you to set any value in the message payload. See the [request body section of the Pusher Beam docs](https://pusher.com/docs/beams/reference/publish-api#request-body) for more information.

### Sending to multiple platforms

[](#sending-to-multiple-platforms)

You can send a single message to an iOS device and an Android device at the same time using the `withiOS()` and `withAndroid()` method:

```
public function toPushNotification($notifiable)
{
    $message = "Your {$notifiable->service} account was approved!";

    return PusherMessage::create()
        ->iOS()
        ->badge(1)
        ->body($message)
        ->withAndroid(
            PusherMessage::create()
                ->title($message)
                ->icon('icon')
        );
}
```

> - Notice that iOS is the default platform, which means you don't have to call `->iOS()`.
> - When using `withAndroid()`, `withiOS()` or `withWeb()` you don't have to define the platform, it's done behind the scenes for you.

### Routing a message

[](#routing-a-message)

By default, the pusher "interest" messages will be sent to will be defined using the {notifiable}.{id} convention, for example `App.User.1`, however you can change this behaviour by including a `routeNotificationFor()` in the notifiable class.

I.e. if you are pushing notification on `User` model, you can go to `App\Models\User` class and implement method:

```
public function routeNotificationForPusherPushNotifications($notification): string
{
    return 'your.custom.interest.string';
}
```

`PusherPushNotifications()` in the notifiable class method returns the interest name.

### Publish to users

[](#publish-to-users)

You can publish to users in the same way that you publish to interests but you must add the following variable to the notifiable model:

```
class Client extends Model
{
    use Notifiable;

    public $pushNotificationType = 'users';
}

```

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)

- [Mohamed Said](https://github.com/themsaid)
- [Marcel Pociot](https://github.com/mpociot)
- [Freek Van der Herten](https://github.com/freekmurze)
- [Sebastian De Deyne](https://github.com/sebastiandedeyne)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

63

—

FairBetter than 99% of packages

Maintenance71

Regular maintenance activity

Popularity58

Moderate usage in the ecosystem

Community30

Small or concentrated contributor base

Maturity78

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~195 days

Recently: every ~319 days

Total

19

Last Release

56d ago

Major Versions

0.0.1 → 1.0.02016-08-23

1.1.0 → 2.0.02020-01-03

2.3.1 → 3.0.02022-02-07

3.0.0 → 4.0.02022-09-24

PHP version history (4 changes)0.0.1PHP &gt;=5.6.4

1.1.0PHP &gt;=7.0

3.0.0PHP &gt;=7.4

4.0.0PHP &gt;=8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/20937037?v=4)[Laravel Notification Channels](/maintainers/laravel-notification-channels)[@laravel-notification-channels](https://github.com/laravel-notification-channels)

---

Top Contributors

[![themsaid](https://avatars.githubusercontent.com/u/4332182?v=4)](https://github.com/themsaid "themsaid (40 commits)")[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (19 commits)")[![atymic](https://avatars.githubusercontent.com/u/50683531?v=4)](https://github.com/atymic "atymic (7 commits)")[![jessarcher](https://avatars.githubusercontent.com/u/4977161?v=4)](https://github.com/jessarcher "jessarcher (6 commits)")[![mpociot](https://avatars.githubusercontent.com/u/804684?v=4)](https://github.com/mpociot "mpociot (4 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (3 commits)")[![casperboone](https://avatars.githubusercontent.com/u/15815208?v=4)](https://github.com/casperboone "casperboone (2 commits)")[![SuperDJ](https://avatars.githubusercontent.com/u/6484766?v=4)](https://github.com/SuperDJ "SuperDJ (1 commits)")[![andreaselia](https://avatars.githubusercontent.com/u/5033092?v=4)](https://github.com/andreaselia "andreaselia (1 commits)")[![wanghanlin](https://avatars.githubusercontent.com/u/2937647?v=4)](https://github.com/wanghanlin "wanghanlin (1 commits)")[![fwartner](https://avatars.githubusercontent.com/u/6692500?v=4)](https://github.com/fwartner "fwartner (1 commits)")[![Norgul](https://avatars.githubusercontent.com/u/11718157?v=4)](https://github.com/Norgul "Norgul (1 commits)")[![oyed](https://avatars.githubusercontent.com/u/172114265?v=4)](https://github.com/oyed "oyed (1 commits)")[![scybulski](https://avatars.githubusercontent.com/u/10341108?v=4)](https://github.com/scybulski "scybulski (1 commits)")[![sebastiandedeyne](https://avatars.githubusercontent.com/u/1561079?v=4)](https://github.com/sebastiandedeyne "sebastiandedeyne (1 commits)")[![stevethomas](https://avatars.githubusercontent.com/u/1127412?v=4)](https://github.com/stevethomas "stevethomas (1 commits)")

---

Tags

laravelnotificationspusherpusher-push-notifications

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/laravel-notification-channels-pusher-push-notifications/health.svg)

```
[![Health](https://phpackages.com/badges/laravel-notification-channels-pusher-push-notifications/health.svg)](https://phpackages.com/packages/laravel-notification-channels-pusher-push-notifications)
```

###  Alternatives

[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k12.1M99](/packages/laravel-pulse)[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2587.7M12](/packages/laravel-notification-channels-twilio)[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)[neo/pusher-beams

Pusher Beams is a push notification service from Pusher.

133.1k](/packages/neo-pusher-beams)

PHPackages © 2026

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