PHPackages                             dsnoeck/laravel-push-notification - 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. dsnoeck/laravel-push-notification

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

dsnoeck/laravel-push-notification
=================================

Laravel package to send push notifications to mobile devices (apns, gcm)

4.2(11y ago)31.6k1PHPPHP &gt;=5.3.0

Since Sep 4Pushed 11y ago1 watchersCompare

[ Source](https://github.com/dsnoeck/laravel-push-notification)[ Packagist](https://packagist.org/packages/dsnoeck/laravel-push-notification)[ RSS](/packages/dsnoeck-laravel-push-notification/feed)WikiDiscussions master Synced 2d ago

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

Laravel Push Notification
=========================

[](#laravel-push-notification)

Package to enable sending push notifications to devices

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

[](#installation)

Update your `composer.json` file to include this package as a dependency. "dev-master" for latest version "4.0" for compatibility with laravel 4.0 "4.2" for compatibility with laravel 4.2

```
"dsnoeck/laravel-push-notification": "dev-master"
```

Register the PushNotification service provider by adding it to the providers array in the `app/config/app.php` file.

```
'providers' => array(
    Davibennun\LaravelPushNotification\LaravelPushNotificationServiceProvider
)

```

Alias the PushNotification facade by adding it to the aliases array in the `app/config/app.php` file.

```
'aliases' => array(
    'PushNotification' => 'Davibennun\LaravelPushNotification\Facades\PushNotification'
)
```

Configuration
=============

[](#configuration)

Copy the config file into your project by running

```
php artisan config:publish davibennun/laravel-push-notification

```

This will generate a config file like this

```
array(
    'appNameIOS'=>array(
        'environment'=>'development',
    	'certificate'=>'/path/to/certificate.pem',
    	'passPhrase'=>'password',
    	'service'=>'apns'
    ),
    'appNameAndroid'=>array(
    	'environment'=>'production',
    	'apiKey'=>'yourAPIKey',
    	'service'=>'gcm'
    )
);

```

Where all first level keys corresponds to an service configuration, each service has its own properties, android for instance have `apiKey` and IOS uses `certificate` and `passPhrase`. You can set as many services configurations as you want, one for each app.

\#####Dont forget to set `service` key to identify IOS `'service'=>'apns'` and Android `'service'=>'gcm'`

\#####The certificate path must be an absolute path, so in the configuration file you can use these:

```
//Path to the 'app' folder
'certificate'=>app_path().'/myCert.pem'

```

Laravel functions are also available `public_path()` `storage_path()` `base_path()`

Usage
=====

[](#usage)

```
PushNotification::app('appNameIOS')
                ->to($deviceToken)
                ->send('Hello World, i`m a push message');
```

Where app argument `appNameIOS` refers to defined service in config file. To multiple devices and optioned message:

```
$devices = PushNotification::DeviceCollection(array(
    PushNotification::Device('token', array('badge' => 5)),
    PushNotification::Device('token1', array('badge' => 1)),
    PushNotification::Device('token2')
));
$message = PushNotification::Message('Message Text',array(
    'badge' => 1,
    'sound' => 'example.aiff',

    'actionLocKey' => 'Action button title!',
    'locKey' => 'localized key',
    'locArgs' => array(
        'localized args',
        'localized args',
        'localized args'
    ),
    'launchImage' => 'image.jpg',

    'custom' => array('custom data' => array(
        'we' => 'want', 'send to app'
    ))
));
PushNotification::app('appNameIOS')
                ->to($devices)
                ->send($message);
```

This package is wrapps [Notification Package](https://github.com/Ph3nol/NotificationPusher) and adds some flavor to it.

\####Usage advice This package should be used with [Laravel Queues](http://laravel.com/docs/queues), so pushes dont blocks the user and are processed in the background, meaning a better flow.

\#License

The Laravel framework is open-sourced software licensed under the \[MIT license\]

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 58.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 ~0 days

Total

2

Last Release

4268d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4009491b40a703eacca6121b078671f8ec7112db029b99dbc7b1cdce6f7e913c?d=identicon)[dsnoeck](/maintainers/dsnoeck)

---

Top Contributors

[![davibennun](https://avatars.githubusercontent.com/u/1722200?v=4)](https://github.com/davibennun "davibennun (14 commits)")[![dsnoeck](https://avatars.githubusercontent.com/u/687942?v=4)](https://github.com/dsnoeck "dsnoeck (7 commits)")[![JavierMartinz](https://avatars.githubusercontent.com/u/1155507?v=4)](https://github.com/JavierMartinz "JavierMartinz (2 commits)")[![pabloleone](https://avatars.githubusercontent.com/u/2090437?v=4)](https://github.com/pabloleone "pabloleone (1 commits)")

---

Tags

laravelpushnotificationgcmapns

### Embed Badge

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

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

###  Alternatives

[sly/notification-pusher

Standalone PHP library for easy devices notifications push.

1.2k2.8M15](/packages/sly-notification-pusher)[edujugon/push-notification

Laravel Package to send push notifications to Android and IOS devices. (GCM,FCM,APN)

4891.4M1](/packages/edujugon-push-notification)[witty/laravel-push-notification

Laravel 5 Package for sending push notifications to Android and iOS devices

245.0k](/packages/witty-laravel-push-notification)[turbo124/laravel-push-notification

Laravel package to send push notifications to mobile devices (apns, gcm)

1157.9k](/packages/turbo124-laravel-push-notification)

PHPackages © 2026

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