PHPackages                             dreamonkey/laravel-onesignal-rest-api - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. dreamonkey/laravel-onesignal-rest-api

ActiveLibrary[HTTP &amp; Networking](/categories/http)

dreamonkey/laravel-onesignal-rest-api
=====================================

OneSignal REST API Wrapper For Laravel/Lumen

v2.4(3y ago)664.0k8MITPHPPHP &gt;=7.2CI failing

Since Jun 6Pushed 1y ago1 watchersCompare

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

READMEChangelog (10)Dependencies (4)Versions (20)Used By (0)

!!!! THIS PACKAGE IS UNMAINTAINED !!!! Feel free to fork and start maintaining a copy yourself, we can link here popular forks

OneSignal REST API Wrapper For Laravel/Lumen
============================================

[](#onesignal-rest-api-wrapper-for-laravellumen)

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

[](#introduction)

This project is a Laravel 6+ / Lumen wrapper for the OneSignal REST API v1. It supports all operations currently supported by the API.

Installation (Laravel and Lumen)
--------------------------------

[](#installation-laravel-and-lumen)

Require the package with composer.

```
composer require dreamonkey/laravel-onesignal-rest-api
```

Laravel Users:
--------------

[](#laravel-users)

Service provider will be auto-discovered.

Lumen Users:
------------

[](#lumen-users)

Update `bootstrap/app.php`, adding the following entry

```
$app->register( \Dreamonkey\OneSignal\OneSignalServiceProvider::class );
class_alias( 'Dreamonkey\OneSignal\OneSignalFacade', 'OneSignal' );
```

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

[](#configuration)

There are three values that need to be set in order to use the library: your default OneSignal app ID, the REST API key and your account User Auth Key. All of these items can be found in your Control Panel on the OneSignal site. First two are app-related and can be found inside your app settings in the "Keys &amp; IDs" tab (upper left corner), the third is account-related and can be found pressing your account avatar (lower right corner) and selecting "Account &amp; API Keys".

Place the 3 keys into your .env file, as such:

```
ONESIGNAL_APP_ID=
ONESIGNAL_REST_API_KEY=
ONESIGNAL_USER_AUTH_KEY=

```

Usage
-----

[](#usage)

There is a function for each of the OneSignal API calls. They are broken down here. All methods will return an array formatted like this:

```
    [
        'status' => < HTTP status code of the request >,
        'data' => [
            < data returned by OneSignal REST API in array format >
        ],
    ]

```

**Note:** In all instances where an $app\_id is asked for, omitting it will grab the default OneSignal App ID specified in the .env file

### Apps

[](#apps)

##### getApps() - Get all Apps for the user

[](#getapps---get-all-apps-for-the-user)

```
$response = OneSignal::getApps();

```

##### getApp( $app\_id ) - Get the given App

[](#getapp-app_id----get-the-given-app)

##### postapp( $data ) - Create a new App

[](#postapp-data----create-a-new-app)

##### putApp( $app\_id, $data ) - Update an App

[](#putapp-app_id-data----update-an-app)

### Players

[](#players)

##### getPlayers( $app\_id, $limit, $offset ) - Get Players from an App

[](#getplayers-app_id-limit-offset----get-players-from-an-app)

##### getPlayer( $id ) - Get Player of the given ID

[](#getplayer-id----get-player-of-the-given-id)

##### postPlayer ( $data, $app\_id ) - Add Player to an App

[](#postplayer--data-app_id----add-player-to-an-app)

##### putPlayer( $data, $app\_id ) - Update Player object for an App

[](#putplayer-data-app_id----update-player-object-for-an-app)

##### postCSVExport( $app\_id ) - Get a CSV dump of all Players for an App

[](#postcsvexport-app_id----get-a-csv-dump-of-all-players-for-an-app)

##### postPlayerOnSession( $data ) - Start a new device session for this Player

[](#postplayeronsession-data----start-a-new-device-session-for-this-player)

##### postPlayerOnPurchase( $data ) - Track a new purchase for this Player

[](#postplayeronpurchase-data----track-a-new-purchase-for-this-player)

##### postPlayerOnFocus( $data ) - Increment the Players total session length

[](#postplayeronfocus-data----increment-the-players-total-session-length)

### Notifications

[](#notifications)

##### getNotifications( $app\_id, $limit, $offset ) - Get all Notifications for an App

[](#getnotifications-app_id-limit-offset----get-all-notifications-for-an-app)

##### getNotification( $id, $app\_id ) - Get a Notification from an App

[](#getnotification-id--app_id----get-a-notification-from-an-app)

##### postNotification( $data, $app\_id ) - Add a Notification to an App

[](#postnotification-data-app_id----add-a-notification-to-an-app)

```
$response = OneSignal::postNotification([
    "tags"                  =>  [ ["key" => "myKey", "relation" => "=", "value" => 1 ] ],
    "contents"              => ["en" => "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean et iaculis enim. Sed egestas porttitor laoreet."],
    "headings"              => ["en" => "Aliquam consectetur odio sed"],
]);

```

##### putNotificationTrackOpen( $id, $app\_id, $opened ) - Track whether a Notification was opened

[](#putnotificationtrackopen-id-app_id-opened----track-whether-a-notification-was-opened)

##### deleteNotification( $id, $app\_id ) - Delete a Notification from an App

[](#deletenotification-id-app_id----delete-a-notification-from-an-app)

References
----------

[](#references)

The official OneSignal API documentation is listed here:

Acknowledgements
----------------

[](#acknowledgements)

This project has been forked and evolved by Dreamonkey from

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance28

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~138 days

Recently: every ~240 days

Total

19

Last Release

1136d ago

Major Versions

v1.3.0 → v2.02020-08-13

PHP version history (4 changes)1.0.0PHP 7.\*|5.4.\*

1.0.2PHP &gt;=5.4

1.0.4PHP &gt;=5.5

v2.0PHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/0f5033bac39667fc110154e11453950d104c830f42aa2a6a15a551cfffe06727?d=identicon)[Dreamonkey](/maintainers/Dreamonkey)

---

Top Contributors

[![IlCallo](https://avatars.githubusercontent.com/u/10036108?v=4)](https://github.com/IlCallo "IlCallo (31 commits)")[![jmrieger](https://avatars.githubusercontent.com/u/9476375?v=4)](https://github.com/jmrieger "jmrieger (24 commits)")[![netodomenico](https://avatars.githubusercontent.com/u/16362468?v=4)](https://github.com/netodomenico "netodomenico (2 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (2 commits)")[![pefernandez](https://avatars.githubusercontent.com/u/4737073?v=4)](https://github.com/pefernandez "pefernandez (1 commits)")[![diegodm2](https://avatars.githubusercontent.com/u/149350428?v=4)](https://github.com/diegodm2 "diegodm2 (1 commits)")[![zhafri-shafiq](https://avatars.githubusercontent.com/u/24999748?v=4)](https://github.com/zhafri-shafiq "zhafri-shafiq (1 commits)")[![ErikDohmen](https://avatars.githubusercontent.com/u/39862207?v=4)](https://github.com/ErikDohmen "ErikDohmen (1 commits)")[![hloehrmann](https://avatars.githubusercontent.com/u/973710?v=4)](https://github.com/hloehrmann "hloehrmann (1 commits)")[![mauricius](https://avatars.githubusercontent.com/u/7000852?v=4)](https://github.com/mauricius "mauricius (1 commits)")

---

Tags

laravelrestpushlumenWebPushonesignal

### Embed Badge

![Health badge](/badges/dreamonkey-laravel-onesignal-rest-api/health.svg)

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

###  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)[rap2hpoutre/jacky

Opinionated REST JSON HTTP API client for laravel

174.4k](/packages/rap2hpoutre-jacky)

PHPackages © 2026

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