PHPackages                             carlosh1989/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. carlosh1989/onesignal-laravel

ActiveLibrary

carlosh1989/onesignal-laravel
=============================

OneSignal Push Wrapper Laravel 5, 6, 7

v1.0(8y ago)0454MITPHPPHP &gt;=5.4.0

Since Oct 15Pushed 5y agoCompare

[ Source](https://github.com/carlosh1989/laravel-onesignal)[ Packagist](https://packagist.org/packages/carlosh1989/onesignal-laravel)[ RSS](/packages/carlosh1989-onesignal-laravel/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (2)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 carloscgo/onesignal-laravel
```

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

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

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

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

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

Finally, from the command line again, run

```
php artisan vendor:publish --tag=config

```

to publish the default configuration file. This will publish a configuration file named `onesignal.php` which includes your OneSignal authorization keys.

> **Note:** If the previous command does not publish the config file successfully, please check the steps involving *providers* and *aliases* in the `config/app.php` file.

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 Title", "Some Message", $url = null, $data = null, $buttons = null, $schedule = null);

```

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

### Sending a Notification based on Tags/Filters

[](#sending-a-notification-based-on-tagsfilters)

You can send a message based on a set of tags with the command

```
OneSignal::sendNotificationUsingTags("Some Title", "Some Message", array("key" => "device_uuid", "relation" => "=", "value" => 123e4567-e89b-12d3-a456-426655440000), $url = null, $data = null, $buttons = null, $schedule = null);

```

### 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 Title", "Some Message", $userId, $url = null, $data = null, $buttons = null, $schedule = null);

```

`$userId` is the user's unique id where he/she is registered for notifications. Read  for additional details. `$url` , `$data` , `$buttons` and `$schedule` 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 Title", "Some Message", $segment, $url = null, $data = null, $buttons = null, $schedule = null);

```

`$url` , `$data` , `$buttons` and `$schedule` 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);

### Sending a Custom Notification

```

### Sending a async Custom Notification

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

You can send a async custom message with

```
OneSignal::async()->sendNotificationCustom($parameters);

```

Please refer to  for all customizable parameters.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

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

Unknown

Total

1

Last Release

3132d ago

### Community

Maintainers

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

---

Top Contributors

[![carloscgo](https://avatars.githubusercontent.com/u/693763?v=4)](https://github.com/carloscgo "carloscgo (1 commits)")[![carloss1989](https://avatars.githubusercontent.com/u/137532524?v=4)](https://github.com/carloss1989 "carloss1989 (1 commits)")

---

Tags

laravelpushWebPushlaravel 5onesignal

### Embed Badge

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

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

###  Alternatives

[berkayk/onesignal-laravel

OneSignal Push Wrapper Laravel

5295.9M12](/packages/berkayk-onesignal-laravel)[jmrieger/onesignal-laravel

OneSignal Push Wrapper For Illuminate

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

PHPackages © 2026

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