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

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

jowxidea/onesignal
==================

A Laravel package for sending push notifications using OneSignal.

v1.0.0(1mo ago)03MITPHPPHP ^8.1CI passing

Since Apr 27Pushed 1mo agoCompare

[ Source](https://github.com/youssef-ahmed-cs/JowXIdea-OneSignal)[ Packagist](https://packagist.org/packages/jowxidea/onesignal)[ RSS](/packages/jowxidea-onesignal/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (4)Versions (2)Used By (0)

JowXIdea OneSignal
==================

[](#jowxidea-onesignal)

A Laravel package for sending OneSignal push notifications with a minimal client API, service provider, facade, and helper function.

Features
--------

[](#features)

- Laravel auto-discovery service provider
- Config publishing (`onesignal-config`)
- Container binding (`onesignal`)
- Facade (`OneSignal`) and helper (`onesignal()`)
- Send to all users, one user, many users, or named segments
- Custom payload support and legacy-compatible notification helpers
- Consistent HTTP response metadata for easier debugging
- Built with Orchestra Testbench for package testing

Requirements
------------

[](#requirements)

- PHP 8.1+
- Laravel 10/11/12

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

[](#installation)

```
composer require jowxidea/onesignal
```

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

[](#configuration)

Publish the config file:

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

Set your environment variables:

```
ONESIGNAL_APP_ID=your_app_id
ONESIGNAL_REST_API_KEY=your_rest_api_key
ONESIGNAL_USER_AUTH_KEY=optional_user_auth_key
ONESIGNAL_API_URL=https://onesignal.com/api/v1
ONESIGNAL_TIMEOUT=10
```

Usage
-----

[](#usage)

### Send to all users

[](#send-to-all-users)

```
onesignal()->sendToAll(
    ['en' => 'Hello everyone'],
    ['en' => 'Announcement'],
    ['source' => 'app']
);
```

### Send to one user

[](#send-to-one-user)

```
onesignal()->sendToUser(
    'player-id-123',
    ['en' => 'Hello user']
);
```

### Send to many users

[](#send-to-many-users)

```
onesignal()->sendToUsers(
    ['player-id-1', 'player-id-2'],
    ['en' => 'Hello group'],
    ['en' => 'Greeting'],
    ['source' => 'app']
);
```

### Send to a segment

[](#send-to-a-segment)

```
onesignal()->sendToSegments(
    ['Subscribed Users'],
    ['en' => 'New update is available'],
    ['en' => 'Update']
);
```

### Sending a custom payload

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

```
onesignal()->send([
    'included_segments' => ['All'],
    'contents' => ['en' => 'Custom payload message'],
    'headings' => ['en' => 'Custom title'],
    'data' => ['source' => 'app'],
]);
```

### Legacy compatible methods

[](#legacy-compatible-methods)

The client keeps compatibility with legacy OneSignal helpers while using Laravel HTTP internally:

- `sendNotificationToAll`
- `sendNotificationToUser`
- `sendNotificationToExternalUser`
- `sendNotificationUsingTags`

### Using the facade

[](#using-the-facade)

```
use Jowxidea\Onesignal\Facades\OneSignal;

OneSignal::sendToSegments(
    ['Subscribed Users'],
    ['en' => 'New update is available'],
    ['en' => 'Update']
);
```

Response format
---------------

[](#response-format)

All API methods return an array. When OneSignal responds with JSON, the decoded response is returned directly and enriched with `_response` metadata:

- `status` — HTTP status code
- `ok` — whether the response status is 200–299
- `successful` — whether the response was successful
- `redirect` — whether the response was a redirect
- `headers` — returned response headers

For non-JSON responses, the package returns:

```
[
    'body' => 'raw response body',
    '_response' => [
        'status' => 200,
        'ok' => true,
        'successful' => true,
        'redirect' => false,
        'headers' => [ ... ],
    ],
]
```

Helper function
---------------

[](#helper-function)

Use the global helper anywhere in your application:

```
$client = onesignal();
```

Testing
-------

[](#testing)

```
composer test
```

License
-------

[](#license)

MIT

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance91

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

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

43d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3da4f4eef5330953fa10eb4244590a8c93d1a62b13cbc35560307dc69a92fff7?d=identicon)[youssef-ahmed-cs](/maintainers/youssef-ahmed-cs)

---

Top Contributors

[![youssef-ahmed-cs](https://avatars.githubusercontent.com/u/127596947?v=4)](https://github.com/youssef-ahmed-cs "youssef-ahmed-cs (9 commits)")

---

Tags

laravelpushnotificationsonesignalnotification servicelaravel - flutter - front

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3325.1M337](/packages/psalm-plugin-laravel)[berkayk/onesignal-laravel

OneSignal Push Wrapper Laravel

5246.1M14](/packages/berkayk-onesignal-laravel)[api-platform/laravel

API Platform support for Laravel

59156.3k10](/packages/api-platform-laravel)[naif/nova-push-notification

A Laravel Nova tool to send push notifications via OneSignal

166.4k](/packages/naif-nova-push-notification)

PHPackages © 2026

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