PHPackages                             andymswick/expo - 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. andymswick/expo

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

andymswick/expo
===============

Laravel notification driver for Expo Push Notifications.

1.0.0(6y ago)021MITPHPPHP &gt;=7.2

Since Feb 2Pushed 6y agoCompare

[ Source](https://github.com/techenby/expo)[ Packagist](https://packagist.org/packages/andymswick/expo)[ Docs](https://github.com/andymswick/expo)[ RSS](/packages/andymswick-expo/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (5)Versions (3)Used By (0)

Expo notification channel for Laravel
=====================================

[](#expo-notification-channel-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/13c08dfc1cb09e07075021cfc39ab33a1f081bf5651eb518b85831de9566461f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616e64796d737769636b2f6578706f2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/andymswick/expo)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/b28a6185f11854d7390375b6c7abcecaf42bfcf860e99de53b2f31d7413d334e/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f6578706f2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/laravel-notification-channels/expo)[![StyleCI](https://camo.githubusercontent.com/aa899cd792bb3e7d736620af080bf688110af0e66cfeee3f00e2a73fce686ae9/68747470733a2f2f7374796c6563692e696f2f7265706f732f3233373831363438392f736869656c64)](https://styleci.io/repos/237725707)[![Quality Score](https://camo.githubusercontent.com/bc36db178fffd84c097c63299525ac6170ce40fa799219d4d76061431ed31148/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f616e64796d737769636b2f6578706f2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/laravel-notification-channels/expo)[![Code Coverage](https://camo.githubusercontent.com/4475b6b570108e4de60419027e450c142bf365269103077366c8998ad766e437/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f616e64796d737769636b2f6578706f2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/laravel-notification-channels/expo/?branch=master)[![Total Downloads](https://camo.githubusercontent.com/b215b18cb7cd4d208490c33967145776f68bc4ba99513d8a6845025ffbd284b7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616e64796d737769636b2f6578706f2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laravel-notification-channels/expo)

This package makes it easy to send push notifications to your [Expo](https://docs.expo.io/versions/latest/guides/push-notifications/) app with Laravel 5.5+ and 6.0.

For more information on how to set up push notifications from within your Expo app, please refer to their [documentation on push notifications](https://docs.expo.io/versions/latest/guides/push-notifications/).

Contents
--------

[](#contents)

- [Installation](#installation)
- [Usage](#usage)
    - [Available Message methods](#available-message-methods)
- [Changelog](#changelog)
- [Testing](#testing)
- [Security](#security)
- [Contributing](#contributing)
- [Credits](#credits)
- [License](#license)

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

[](#installation)

You can install this package via composer using this command:

```
composer require "laravel-notification-channels/expo"
```

The package will automatically register itself.

You can publish the optional migration with:

```
php artisan vendor:publish --provider="NotificationChannels\Expo\ExpoServiceProvider" --tag="migrations"
```

After the migration has been published you can add the `push_token` the users table by running the migrations:

```
php artisan migrate
```

You can publish the optional config-file with:

```
php artisan vendor:publish --provider="NotificationChannels\Expo\ExpoServiceProvider" --tag="config"
```

This is the contents of the published config file:

```
return [

    /*
     * The attribute on the notifiable that will be accessed by default for the `to` method.
     */
    'token' => env('EXPO_PUSH_TOKEN', 'push_token'),

];
```

Usage
-----

[](#usage)

If a notification supports being sent as a Expo push notification, you should define a `toExpo` method on the notification class. This method will receive a `$notifiable` entity and should return a `NotificationChannels\Expo\ExpoMessage` instance. Expo messages may contain a title and body as well as "jsonData" that adds additional data that is sent to the Expo app. Let's take a look at a basic `toExpo` example:

```
// ...
use NotificationChannels\Expo\ExpoChannel;
use NotificationChannels\Expo\ExpoMessage;

class CheckInTime extends Notification
{

	// ...

    public function via($notifiable)
    {
        return [ExpoChannel::class];
    }

    public function toExpo($notifiable)
    {
        return (new ExpoMessage)
            ->title("It's time to check in!")
            ->body('Check in now for us to print your name badge')
            ->setJsonData(['screen' => 'CheckIn']);
    }
}
```

A `to` method is required if the notifiable does not have a `token` value set in `config/expo.php`. You can optionally publish this config as well as a migration that will add a `push_token` to the `users` table after `remember_token`.

Below is an example of using the `to` method, if you would rather not use the config or migration.

```
// ...
use NotificationChannels\Expo\ExpoChannel;
use NotificationChannels\Expo\ExpoMessage;

class CheckInTime extends Notification
{

	// ...

    public function via($notifiable)
    {
        return [ExpoChannel::class];
    }

    public function toExpo($notifiable)
    {
		return (new ExpoMessage)
			->to('ExponentPushToken[**********************]')
            ->title("It's time to check in!")
            ->body('Check in now for us to print your name badge')
            ->setJsonData(['screen' => 'CheckIn']);
    }
}
```

### Available Message methods

[](#available-message-methods)

- `to(string)`: Set the recipient of the message. This will default to the notifiable's `push_token` attribute.
- `title(string)`: Set the title of the message.
- `body(string)`: Set the body of the message.
- `enableSound()`: Enable the default sound to be played.
- `disableSound()`: Disable the default sound to be played.
- `badge(int)`: Set the badge to the int value. (iOS only)
- `setTtl(int)`: Set the time to live value. (iOS only)
- `setChanelId(int)`: Set the chanelId of the notification. (Android only)
- `setJsonData(array|string)`: Set the extra data of the notification, can be passed an array or a json string.
- `toArray()`: Converts the message to an array.

Changelog
---------

[](#changelog)

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

Testing
-------

[](#testing)

```
$ composer test
```

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

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

[](#contributing)

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

Credits
-------

[](#credits)

- [Andy Swick](https://github.com/andymswick)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

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

2296d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3c6fdde47e6975072038750c283c282a0a1282181467838e940ec17a3c7afdb0?d=identicon)[techenby](/maintainers/techenby)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/andymswick-expo/health.svg)

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

###  Alternatives

[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)[laravel-notification-channels/aws-sns

Amazon Simple Notification Service (AWS SNS) notification channel for Laravel.

541.1M2](/packages/laravel-notification-channels-aws-sns)

PHPackages © 2026

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