PHPackages                             neo/pusher-beams - 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. neo/pusher-beams

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

neo/pusher-beams
================

Pusher Beams is a push notification service from Pusher.

v1.0.5(6y ago)133.1k10[2 issues](https://github.com/neoighodaro/pusher-beams/issues)MITPHPPHP &gt;=7.0

Since May 4Pushed 1y ago3 watchersCompare

[ Source](https://github.com/neoighodaro/pusher-beams)[ Packagist](https://packagist.org/packages/neo/pusher-beams)[ Docs](https://github.com/neoighodaro/pusher-beams)[ RSS](/packages/neo-pusher-beams/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (7)Versions (7)Used By (0)

Pusher Beams - push notifications for Laravel
=============================================

[](#pusher-beams---push-notifications-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/c50cce751d8be10819f1fdd3a48d595c5f20031b1a502ab5db5b41c4af76168b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e656f2f7075736865722d6265616d732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/neo/pusher-beams)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/7608b95c8f50e9a744340fa0b979d7b7454f939bfe08ae2c78e95edc80d55959/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6e656f6967686f6461726f2f7075736865722d6265616d732f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/neoighodaro/pusher-beams)[![StyleCI](https://camo.githubusercontent.com/5aa508ba52e7eef928bd37347e405de61819fed2055ea4391529980b2f2f0211/68747470733a2f2f7374796c6563692e696f2f7265706f732f36353337393332312f736869656c64)](https://styleci.io/repos/65379321)[![Quality Score](https://camo.githubusercontent.com/88be71c0ce1d48d2a0cad8b68202f54559e6c31eefae09a83ebf986f2f0e6fdf/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6e656f6967686f6461726f2f7075736865722d6265616d732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/neoighodaro/pusher-beams)

This package makes it easy to send [Pusher push notifications](https://docs.pusher.com/push-notifications) with Laravel (should work with other non-laravel PHP projects). It's based off [this package](https://github.com/laravel-notification-channels/pusher-push-notifications) by Mohamed Said.

Contents
--------

[](#contents)

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

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

[](#installation)

You can install the package via composer:

```
composer require neo/pusher-beams
```

...

### Setting up your Pusher account

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

...

Usage
-----

[](#usage)

Update your `.env` file with the following keys:

```
PUSHER_BEAMS_SECRET_KEY="PUSHER_BEAMS_SECRET_KEY"
PUSHER_BEAMS_INSTANCE_ID="PUSHER_BEAMS_INSTANCE_ID"

```

> 💡 You need to replace the PUSHER\_BEAMS\_SECRET\_KEY and PUSHER\_BEAMS\_INSTANCE\_ID keys with the keys gotten from your Pusher dashboard.

Open the broadcasting.php file in the config directory and add the following keys to the pusher connection array:

```
'connections' => [
    'pusher' => [
        // [...]

        'beams' => [
            'secret_key' => env('PUSHER_BEAMS_SECRET_KEY'),
            'instance_id' => env('PUSHER_BEAMS_INSTANCE_ID'),
        ],

        // [...]
    ],
],

```

Next, create a new notification class where we will add our push notification. In your terminal run the command below to create the class:

```
$ php artisan make:notification UserCommented

```

This will create a new `UserCommented` class in the `app/Notifications` directory. Open the file and you can do something similar to this sample class:

```
