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

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

macellan/onesignal
==================

OneSignal notifications channel for Laravel

v3.2.0(1mo ago)55.2k—0%4MITPHPPHP &gt;=8.3CI passing

Since Feb 24Pushed 1mo ago3 watchersCompare

[ Source](https://github.com/macellan/onesignal)[ Packagist](https://packagist.org/packages/macellan/onesignal)[ Docs](https://macellan.net/)[ RSS](/packages/macellan-onesignal/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (22)Versions (19)Used By (0)

OneSignal Notifications Channel for Laravel
===========================================

[](#onesignal-notifications-channel-for-laravel)

[![Tests](https://github.com/macellan/onesignal/actions/workflows/tests.yml/badge.svg)](https://github.com/macellan/onesignal/actions/workflows/tests.yml/badge.svg)[![Latest Stable Version](https://camo.githubusercontent.com/7a8ecee7629679b664f6b3f4048836faf9ef8d7c9b0bd9b65f4ea8c3e5f5afa0/68747470733a2f2f706f7365722e707567782e6f72672f6d6163656c6c616e2f6f6e657369676e616c2f762f737461626c65)](https://packagist.org/packages/macellan/onesignal)[![Total Downloads](https://camo.githubusercontent.com/a9f7b6b1dc07891f62e8a265c4fddd983412d423cad8eda390d83790f81aa0a7/68747470733a2f2f706f7365722e707567782e6f72672f6d6163656c6c616e2f6f6e657369676e616c2f646f776e6c6f616473)](https://packagist.org/packages/macellan/onesignal)

This package makes it easy to send push notifications using [OneSignal](https://onesignal.com/) with Laravel 9.0 and 10.0, 11.0

This plugin sends notifications only with OneSignal Player ID.

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

[](#installation)

You can install this package via composer:

```
composer require macellan/onesignal
```

### Settings

[](#settings)

Add your OneSignal appId to your config/services.php:

```
// config/services.php
...
    'onesignal' => [
        'app_id' => env('ONESIGNAL_APP_ID', ''),
    ],
...
```

Usage
-----

[](#usage)

You can use the channel in your via() method inside the notification:

```
use Illuminate\Notifications\Notification;
use Macellan\OneSignal\OneSignalMessage;

class AccountApproved extends Notification
{
    public function via($notifiable)
    {
        return ['onesignal'];
    }

    public function toOneSignal($notifiable)
    {
        return OneSignalMessage::create()
            ->setSubject('Awesome App')
            ->setBody('Your account was approved!');
    }
}
```

You can change appId of a specific notification, just add the setAppId() method

```
   public function toOneSignal($notifiable)
    {
        return OneSignalMessage::create()
            ->setAppId('Other AppId')
    }
```

In your notifiable model, make sure to include a routeNotificationForOneSignal() method.

```
public function routeNotificationForOneSignal()
{
    return $this->player_id;
}
```

### On-Demand Notifications

[](#on-demand-notifications)

Sometimes you may need to send a notification to someone who is not stored as a "user" of your application. Using the Notification::route method, you may specify ad-hoc notification routing information before sending the notification:

```
Notification::route('onesignal', 'player_id')
            ->notify(new AccountApproved());
```

Credits
-------

[](#credits)

- [Fatih Aytekin](https://github.com/faytekin)

###  Health Score

55

—

FairBetter than 98% of packages

Maintenance89

Actively maintained with recent releases

Popularity28

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 77.5% 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 ~98 days

Recently: every ~148 days

Total

16

Last Release

54d ago

Major Versions

v1.4.0 → v2.02024-08-01

v2.0 → v3.0.02025-03-24

PHP version history (4 changes)v1.0.0PHP &gt;=7.4

v2.0PHP ^8.1

v3.0.0PHP &gt;=8.2

v3.2.0PHP &gt;=8.3

### Community

Maintainers

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

---

Top Contributors

[![faytekin](https://avatars.githubusercontent.com/u/4013224?v=4)](https://github.com/faytekin "faytekin (31 commits)")[![envercigal](https://avatars.githubusercontent.com/u/31448593?v=4)](https://github.com/envercigal "envercigal (3 commits)")[![mertasan](https://avatars.githubusercontent.com/u/13007665?v=4)](https://github.com/mertasan "mertasan (2 commits)")[![nozdogan](https://avatars.githubusercontent.com/u/53572238?v=4)](https://github.com/nozdogan "nozdogan (2 commits)")[![ahme-d](https://avatars.githubusercontent.com/u/9767569?v=4)](https://github.com/ahme-d "ahme-d (1 commits)")[![epicentre](https://avatars.githubusercontent.com/u/2106557?v=4)](https://github.com/epicentre "epicentre (1 commits)")

---

Tags

laravelnotificationnotification-channelonesignalpush-notifications

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

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

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

###  Alternatives

[laravel/slack-notification-channel

Slack Notification Channel for laravel.

89069.7M111](/packages/laravel-slack-notification-channel)[laravel-notification-channels/telegram

Telegram Notifications Channel for Laravel

1.1k3.4M35](/packages/laravel-notification-channels-telegram)[laravel-notification-channels/fcm

FCM (Firebase Cloud Messaging) Notifications Driver for Laravel

5917.0M16](/packages/laravel-notification-channels-fcm)[s-ichikawa/laravel-sendgrid-driver

This library adds a 'sendgrid' mail driver to Laravel.

4139.3M1](/packages/s-ichikawa-laravel-sendgrid-driver)[laravel-notification-channels/microsoft-teams

A Laravel Notification Channel for Microsoft Teams

1603.0M7](/packages/laravel-notification-channels-microsoft-teams)[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)

PHPackages © 2026

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