PHPackages                             ronasit/laravel-exponent-push-notifications - 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. ronasit/laravel-exponent-push-notifications

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

ronasit/laravel-exponent-push-notifications
===========================================

Exponent push notifications driver for laravel

1.5.1(1mo ago)42.5k↑28.3%MITPHPPHP ^8.3CI failing

Since Feb 3Pushed 1mo agoCompare

[ Source](https://github.com/RonasIT/laravel-exponent-push-notifications)[ Packagist](https://packagist.org/packages/ronasit/laravel-exponent-push-notifications)[ Docs](https://github.com/alymosul/laravel-exponent-push-notifications)[ RSS](/packages/ronasit-laravel-exponent-push-notifications/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (7)Dependencies (26)Versions (14)Used By (0)

Exponent push notifications channel for Laravel
===============================================

[](#exponent-push-notifications-channel-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/43b7f48f4a849c05abccf39316af2dcca73b6724ab4f5b681bc335c276855919/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f726f6e617369742f6c61726176656c2d6578706f6e656e742d707573682d6e6f74696669636174696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ronasit/laravel-exponent-push-notifications)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Coverage Status](https://camo.githubusercontent.com/4c5ecf851efde6b533bc51d40c7079e3736e12e4c27b43af63ea17e1a0ce9026/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f526f6e617349542f6c61726176656c2d6578706f6e656e742d707573682d6e6f74696669636174696f6e732f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/RonasIT/laravel-exponent-push-notifications?branch=master)[![Total Downloads](https://camo.githubusercontent.com/12c45d7505cc24bbf998bfe1fa28c1420000f202c4080fecf72793ee7c897d81/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f726f6e617369742f6c61726176656c2d6578706f6e656e742d707573682d6e6f74696669636174696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ronasit/laravel-exponent-push-notifications)

This package provides an Expo push notification channel for Laravel, allowing you to send notifications to mobile devices via the [Expo SDK](https://docs.expo.dev/push-notifications/overview/).

Contents
--------

[](#contents)

- [Installation](#installation)
- [Usage](#usage)
    - [Push tokens API](#push-tokens-api)
    - [Message customization](#message-customization)
    - [Routing a message](#routing-a-message)
- [Changelog](#changelog)
- [Testing](#testing)
- [Security](#security)
- [Contributing](#contributing)
- [Credits](#credits)
- [License](#license)

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

[](#installation)

Install the package via composer:

```
composer require ronasit/laravel-exponent-push-notifications
```

Publish the config file (optionally):

```
php artisan vendor:publish --provider="NotificationChannels\ExpoPushNotifications\ExpoPushNotificationsServiceProvider" --tag="config"
```

### Storage Drivers

[](#storage-drivers)

Package provides several drivers to store the push tokens:

DriverWhen to use`file` (default)Simple setups, single-server, no database required`database`Multi-server deployments, persistent storage, flexible queriesStorage driver may be configured via the `EXPONENT_PUSH_NOTIFICATION_INTERESTS_STORAGE_DRIVER` env variable.

#### Database driver

[](#database-driver)

To use the `database` driver need to publish and run package migration:

```
php artisan vendor:publish --provider="NotificationChannels\ExpoPushNotifications\ExpoPushNotificationsServiceProvider" --tag="migrations"
php artisan migrate
```

Important

The migration uses the table name defined in `interests.database.table_name` from the config (`exponent_push_notification_interests` by default).

Usage
-----

[](#usage)

To send an Expo push notification, add `ExpoChannel::class` to the `via()` method of your notification class and implement the `toExpoPush()` method:

```
use App\Models\User;
use NotificationChannels\ExpoPushNotifications\ExpoChannel;
use NotificationChannels\ExpoPushNotifications\ExpoMessage;
use Illuminate\Notifications\Notification;

class AccountApproved extends Notification
{
    public function via(User $notifiable): array
    {
        return [ExpoChannel::class];
    }

    public function toExpoPush(User $notifiable): ExpoMessage
    {
        return ExpoMessage::create()
            ->badge(1)
            ->enableSound()
            ->title("Congratulations!")
            ->body("Your {$notifiable->service} account was approved!");
    }
}
```

### Push tokens API

[](#push-tokens-api)

The package automatically registers the following endpoints for managing device subscriptions:

#### `POST /exponent/devices/subscribe`

[](#post-exponentdevicessubscribe)

FieldTypeRequiredDescription`expo_token`stringYesThe Expo push token of the device to subscribe#### `POST /exponent/devices/unsubscribe`

[](#post-exponentdevicesunsubscribe)

FieldTypeRequiredDescription`expo_token`stringNoThe Expo push token to remove. If omitted, all tokens for the authenticated user will be removedThe middleware applied to these endpoints is configured via the `middleware` key in the config file.

The package registers all endpoints automatically. To customize their middleware, prefix, or guards, call `Route::expo()` in your routes file — this disables the automatic registration:

```
Route::prefix('v{version}')->group(function () {
    Route::middleware('auth_group')->group(function () {
        // other routes
        Route::expo();
    });
});
```

### Message customization

[](#message-customization)

`ExpoMessage` may be customized using the following methods:

MethodDescriptionNotes`title`Sets the notification titleDefault: `null``body`Sets the notification bodyDefault: `''``enableSound`Enables the notification soundSets sound to `'default'``disableSound`Mutes the notification soundSets sound to `null``badge`Sets the badge count on the app iconDefault: `0``setTtl`Sets the time to live in secondsDefault: `0``setJsonData`Sets additional payload dataAccepts array or JSON string.
Throws `CouldNotCreateMessage` on invalid JSON`setChannelId`Sets the notification channel IDAndroid only`priority`Sets the delivery priorityDefault: `PriorityEnum::Default`.
Available: `::Default`, `::Normal`, `::High``setInterruptionLevel`Sets the interruption leveliOS only.
Available: `InterruptionLevelEnum::Active`, `::Critical`, `::Passive`, `::TimeSensitive`For example, to send a high-priority time-sensitive notification on iOS:

```
use NotificationChannels\ExpoPushNotifications\ExpoMessage;
use NotificationChannels\ExpoPushNotifications\Enums\PriorityEnum;
use NotificationChannels\ExpoPushNotifications\Enums\InterruptionLevelEnum;

ExpoMessage::create()
    ->title('Important!')
    ->body('This is a critical alert.')
    ->priority(PriorityEnum::High)
    ->setInterruptionLevel(InterruptionLevelEnum::TimeSensitive);
```

### Routing a message

[](#routing-a-message)

An **interest** is a named subscription that links a device's push token to a logical target (e.g. a specific user). When sending a notification, the package looks up all tokens registered under that interest and delivers the message to them.

By default, the interest that a message is sent to is derived from the notifiable model using the `{ClassName}.{id}` convention (e.g. `App.Models.User.1`).

You can override this by adding a `routeNotificationForExpoPushNotifications()` method to your notifiable model:

```
use Illuminate\Notifications\Notifiable;

class User extends Model
{
    use Notifiable;

    public function routeNotificationForExpoPushNotifications(): string
    {
        return 'App.Models.User.' . $this->id;
    }
}
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Testing
-------

[](#testing)

```
composer test
```

Security
--------

[](#security)

If you discover any security related issues, please use the [GitHub issue tracker](https://github.com/RonasIT/laravel-exponent-push-notifications/issues).

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Aly Suleiman](https://github.com/Alymosul) — original author
- [RonasIT](https://github.com/RonasIT)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance92

Actively maintained with recent releases

Popularity25

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor3

3 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 ~79 days

Recently: every ~96 days

Total

7

Last Release

38d ago

PHP version history (2 changes)1.0PHP ^8.1

1.4PHP ^8.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1585993?v=4)[Evgeny Leonov](/maintainers/eleonov)[@eleonov](https://github.com/eleonov)

![](https://avatars.githubusercontent.com/u/129854316?v=4)[DPankratov](/maintainers/DPankratov)[@dpankratov](https://github.com/dpankratov)

---

Top Contributors

[![AZabolotnikov](https://avatars.githubusercontent.com/u/110885041?v=4)](https://github.com/AZabolotnikov "AZabolotnikov (84 commits)")[![Alymosul](https://avatars.githubusercontent.com/u/8314647?v=4)](https://github.com/Alymosul "Alymosul (66 commits)")[![DenTray](https://avatars.githubusercontent.com/u/9486872?v=4)](https://github.com/DenTray "DenTray (59 commits)")[![RGO230](https://avatars.githubusercontent.com/u/76399317?v=4)](https://github.com/RGO230 "RGO230 (48 commits)")[![patrickkivits](https://avatars.githubusercontent.com/u/727174?v=4)](https://github.com/patrickkivits "patrickkivits (21 commits)")[![vitgrams](https://avatars.githubusercontent.com/u/126395087?v=4)](https://github.com/vitgrams "vitgrams (11 commits)")[![pelmered](https://avatars.githubusercontent.com/u/680058?v=4)](https://github.com/pelmered "pelmered (9 commits)")[![artengin](https://avatars.githubusercontent.com/u/152782500?v=4)](https://github.com/artengin "artengin (9 commits)")[![sebastiansson](https://avatars.githubusercontent.com/u/3044878?v=4)](https://github.com/sebastiansson "sebastiansson (7 commits)")[![ddedic](https://avatars.githubusercontent.com/u/49714?v=4)](https://github.com/ddedic "ddedic (4 commits)")[![Rubens10010](https://avatars.githubusercontent.com/u/11839305?v=4)](https://github.com/Rubens10010 "Rubens10010 (3 commits)")[![mediabc](https://avatars.githubusercontent.com/u/19846393?v=4)](https://github.com/mediabc "mediabc (3 commits)")[![pirs1337](https://avatars.githubusercontent.com/u/98943794?v=4)](https://github.com/pirs1337 "pirs1337 (3 commits)")[![abdullah-abunada](https://avatars.githubusercontent.com/u/1808834?v=4)](https://github.com/abdullah-abunada "abdullah-abunada (2 commits)")[![enriconardo](https://avatars.githubusercontent.com/u/870900?v=4)](https://github.com/enriconardo "enriconardo (2 commits)")[![jindraregal](https://avatars.githubusercontent.com/u/4135505?v=4)](https://github.com/jindraregal "jindraregal (2 commits)")[![luklapp](https://avatars.githubusercontent.com/u/6569846?v=4)](https://github.com/luklapp "luklapp (2 commits)")[![macr1408](https://avatars.githubusercontent.com/u/13187467?v=4)](https://github.com/macr1408 "macr1408 (2 commits)")[![mpociot](https://avatars.githubusercontent.com/u/804684?v=4)](https://github.com/mpociot "mpociot (2 commits)")[![samuelvisscher](https://avatars.githubusercontent.com/u/11761002?v=4)](https://github.com/samuelvisscher "samuelvisscher (2 commits)")

---

Tags

expopush-notifications

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/ronasit-laravel-exponent-push-notifications/health.svg)

```
[![Health](https://phpackages.com/badges/ronasit-laravel-exponent-push-notifications/health.svg)](https://phpackages.com/packages/ronasit-laravel-exponent-push-notifications)
```

###  Alternatives

[spatie/laravel-failed-job-monitor

Get notified when a queued job fails

1.1k2.8M4](/packages/spatie-laravel-failed-job-monitor)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135224.7k7](/packages/statamic-rad-pack-runway)[api-platform/laravel

API Platform support for Laravel

58171.6k14](/packages/api-platform-laravel)[ecotone/laravel

Ecotone for Laravel — CQRS, Event Sourcing, Sagas, Durable Workflows, and Outbox on top of Laravel Queue, via PHP attributes.

21318.6k3](/packages/ecotone-laravel)[duncanmcclean/statamic-cargo

Comprehensive e-commerce addon for Statamic. Build bespoke e-commerce sites without the complexity.

3417.0k](/packages/duncanmcclean-statamic-cargo)

PHPackages © 2026

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