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

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

daim2k5/laravel-push-notification
=================================

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

1.0.4(9y ago)18631PHPPHP &gt;=5.3.0

Since Mar 22Pushed 9y agoCompare

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

READMEChangelog (5)Dependencies (2)Versions (6)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

Laravel 5 &amp; Lumen

```
"daim2k5/laravel-push-notification": "1.*"
```

Register the PushNotification service provider by adding it to the providers array.

```
'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: (Lumen users skip this)

Laravel 5

```
php artisan vendor:publish --provider="Davibennun\LaravelPushNotification\LaravelPushNotificationServiceProvider" --tag="config"
```

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'`

[](#dont-forget-to-set-service-key-to-identify-ios-serviceapns-and-android-servicegcm)

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

[](#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.

\###Dynamic configuration and Lumen users You can set the app config array directly: (keep in mind the array schema)

```
//iOS app
PushNotification::app(['environment' => 'development',
		'certificate' => '/path/to/certificate.pem',
		'passPhrase'  => 'password',
		'service'     => 'apns']);
//Android app
PushNotification::app(['environment' => 'production',
		'apiKey'      => 'yourAPIKey',
		'service'     => 'gcm']);
```

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',
    ),
    'launchImage' => 'image.jpg',

    'custom' => array('custom data' => array(
        'we' => 'want', 'send to app'
    ))
));

$collection = PushNotification::app('appNameIOS')
    ->to($devices)
    ->send($message);

// get response for each device push
foreach ($collection->pushManager as $push) {
    $response = $push->getAdapter()->getResponse();
}

// access to adapter for advanced settings
$push = PushNotification::app('appNameAndroid');
$push->adapter->setAdapterParameters(['sslverifypeer' => false]);
```

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

#### Usage advice

[](#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.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 61.8% 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

5

Last Release

3337d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/bfb13c0414dc3e88cd81e705caccbf3457bc9ba9cd87a729ad4b8761ff47a939?d=identicon)[daim2k5](/maintainers/daim2k5)

---

Top Contributors

[![davibennun](https://avatars.githubusercontent.com/u/1722200?v=4)](https://github.com/davibennun "davibennun (21 commits)")[![daim2k5](https://avatars.githubusercontent.com/u/656150?v=4)](https://github.com/daim2k5 "daim2k5 (8 commits)")[![JavierMartinz](https://avatars.githubusercontent.com/u/1155507?v=4)](https://github.com/JavierMartinz "JavierMartinz (2 commits)")[![byhbt](https://avatars.githubusercontent.com/u/948856?v=4)](https://github.com/byhbt "byhbt (1 commits)")[![lookitsatravis](https://avatars.githubusercontent.com/u/606978?v=4)](https://github.com/lookitsatravis "lookitsatravis (1 commits)")[![pabloleone](https://avatars.githubusercontent.com/u/2090437?v=4)](https://github.com/pabloleone "pabloleone (1 commits)")

---

Tags

laravelpushnotificationgcmFCMapns

### Embed Badge

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

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

###  Alternatives

[edujugon/push-notification

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

4891.4M1](/packages/edujugon-push-notification)[mcfedr/awspushbundle

A set of services to simplify using Aws to send push notifications

40378.6k1](/packages/mcfedr-awspushbundle)[turbo124/laravel-push-notification

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

1157.9k](/packages/turbo124-laravel-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)

PHPackages © 2026

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