PHPackages                             maykonn/onesignal-laravel - 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. [API Development](/categories/api)
4. /
5. maykonn/onesignal-laravel

ActiveLibrary[API Development](/categories/api)

maykonn/onesignal-laravel
=========================

OneSignal Push Wrapper Laravel

v0.9.5(9y ago)1371MITPHPPHP &gt;=5.4.0

Since Apr 29Pushed 9y ago1 watchersCompare

[ Source](https://github.com/Maykonn/laravel-onesignal)[ Packagist](https://packagist.org/packages/maykonn/onesignal-laravel)[ RSS](/packages/maykonn-onesignal-laravel/feed)WikiDiscussions master Synced today

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

OneSignal Push Notifications for Laravel 5
==========================================

[](#onesignal-push-notifications-for-laravel-5)

Introduction
------------

[](#introduction)

This is a simple OneSignal wrapper library for Laravel. It simplifies the basic notification flow with the defined methods. You can send a message to all users or you can notify a single user. Before you start installing this service, please complete your OneSignal setup at  and finish all the steps that is necessary to obtain an application id and REST API Keys.

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

[](#installation)

First, you'll need to require the package with Composer:

```
composer require berkayk/onesignal-laravel
```

Aftwards, run `composer update` from your command line.

Then, update `config/app.php` by adding an entry for the service provider.

```
'providers' => [
	// ...
	Berkayk\OneSignal\OneSignalServiceProvider::class
];
```

Then, register class alias by adding an entry in aliases section

```
'aliases' => [
	// ...
	'OneSignal' => Berkayk\OneSignal\OneSignalFacade::class
];
```

Finally, from the command line again, run `php artisan vendor:publish` to publish the default configuration file. This will publish a configuration file named `onesignal.php` which includes your OneSignal authorization keys.

Configuration
-------------

[](#configuration)

You need to fill in `onesignal.php` file that is found in your applications `config` directory. `app_id` is your *OneSignal App ID* and `rest_api_key` is your *REST API Key*.

Usage
-----

[](#usage)

### Sending a Notification To All Users

[](#sending-a-notification-to-all-users)

You can easily send a message to all registered users with the command

```
OneSignal::sendNotificationToAll("Some Message");
OneSignal::sendNotificationToAll("Some Message", $url);
OneSignal::sendNotificationToAll("Some Message", $url, $data);
OneSignal::sendNotificationToAll("Some Message", $url, $data, $buttons);

```

`$url` , `$data` and `$buttons` fields are exceptional. If you provide a `$url` parameter, users will be redirecting to that url.

### Sending a Notification To A Specific User

[](#sending-a-notification-to-a-specific-user)

After storing a user's tokens in a table, you can simply send a message with

```
OneSignal::sendNotificationToUser("Some Message", $userId);
OneSignal::sendNotificationToUser("Some Message", $userId, $url);
OneSignal::sendNotificationToUser("Some Message", $userId, $url, $data);
OneSignal::sendNotificationToUser("Some Message", $userId, $url, $data, $buttons);

```

`$userId` is the user's unique id where he/she is registered for notifications. Read  for additional details. `$url` , `$data` and `$buttons` fields are exceptional. If you provide a `$url` parameter, users will be redirecting to that url.

### Sending a Notification To Segment

[](#sending-a-notification-to-segment)

You can simply send a notification to a specific segment with

```
OneSignal::sendNotificationToSegment("Some Message", $segment);
OneSignal::sendNotificationToSegment("Some Message", $segment, $url);
OneSignal::sendNotificationToSegment("Some Message", $segment, $url, $data);
OneSignal::sendNotificationToSegment("Some Message", $segment, $url, $data, $buttons);

```

`$url` , `$data` and `$buttons` fields are exceptional. If you provide a `$url` parameter, users will be redirecting to that url.

### Sending a Custom Notification

[](#sending-a-custom-notification)

You can send a custom message with

```
OneSignal::sendNotificationCustom($parameters);

```

Please refer to  for all customizable parameters.

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 64.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 ~44 days

Recently: every ~55 days

Total

6

Last Release

3490d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/31bf0a2726e29a0d4e14e44e0ba3b02a5eff45a77c1cc603b43c42d914a22f0c?d=identicon)[Maykonn](/maintainers/Maykonn)

---

Top Contributors

[![berkayk](https://avatars.githubusercontent.com/u/603844?v=4)](https://github.com/berkayk "berkayk (18 commits)")[![Maykonn](https://avatars.githubusercontent.com/u/1479805?v=4)](https://github.com/Maykonn "Maykonn (8 commits)")[![jmrieger](https://avatars.githubusercontent.com/u/9476375?v=4)](https://github.com/jmrieger "jmrieger (1 commits)")[![narazin](https://avatars.githubusercontent.com/u/5402603?v=4)](https://github.com/narazin "narazin (1 commits)")

---

Tags

laravelpushWebPushlaravel 5onesignal

### Embed Badge

![Health badge](/badges/maykonn-onesignal-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/maykonn-onesignal-laravel/health.svg)](https://phpackages.com/packages/maykonn-onesignal-laravel)
```

###  Alternatives

[berkayk/onesignal-laravel

OneSignal Push Wrapper Laravel

5236.1M14](/packages/berkayk-onesignal-laravel)[moonshine/moonshine

Laravel administration panel

1.3k239.9k76](/packages/moonshine-moonshine)[spatie/laravel-export

Create a static site bundle from a Laravel app

672139.5k6](/packages/spatie-laravel-export)[simplestats-io/laravel-client

Analytics for Laravel. Track visitors, registrations, and payments. Discover which channels actually drive revenue, not just traffic. Server-side, GDPR compliant, ad-blocker proof.

5019.3k](/packages/simplestats-io-laravel-client)[jmrieger/onesignal-laravel

OneSignal Push Wrapper For Illuminate

2618.3k](/packages/jmrieger-onesignal-laravel)

PHPackages © 2026

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