PHPackages                             santigp258/expo-notification-channel - 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. santigp258/expo-notification-channel

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

santigp258/expo-notification-channel
====================================

Expo Notifications driver for Laravel

v1.0.0(3y ago)069MITPHPPHP &gt;=7.4 | ^8.0

Since Jul 20Pushed 3y agoCompare

[ Source](https://github.com/WiuApp/expo-notifications-channel)[ Packagist](https://packagist.org/packages/santigp258/expo-notification-channel)[ Docs](https://github.com/WiuApp/expo-notifications-channel)[ RSS](/packages/santigp258-expo-notification-channel/feed)WikiDiscussions main Synced 1mo ago

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

Expo Push Notifications Channel
===============================

[](#expo-push-notifications-channel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/d9f24aa2ce11bfa0daac1abd7e0842f3636fae17ecc756db7cba7ce405a9ef2e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f6578706f2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laravel-notification-channels/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/0baef8acfa9b5ff1988ad116f18af401e47eba78d6f38e9dfab99bf092f9d1d9/68747470733a2f2f7374796c6563692e696f2f7265706f732f3338333635363934392f736869656c64)](https://styleci.io/repos/383656949)[![Quality Score](https://camo.githubusercontent.com/e5d000d1779decb4509087bf9b5810dc7524181c0645c0b3d2c6f0c5bfc805af/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f6578706f2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/laravel-notification-channels/expo)[![Code Coverage](https://camo.githubusercontent.com/7f032242af5641c214ce77dd0e3a1e8b3e852a3fb4f43fc06fc8e854cf45f420/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f6578706f2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/laravel-notification-channels/expo/?branch=master)[![Total Downloads](https://camo.githubusercontent.com/c8221453858362b3ab294fe215c1a2550bba72f89285be153fc36747de2e960c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f6578706f2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laravel-notification-channels/expo)

This package makes it easy to send notifications using [Expo](https://docs.expo.io/push-notifications/overview/) with Laravel 8.x

Contents
--------

[](#contents)

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

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

[](#installation)

Install this package with Composer:

```
composer require santigp258/expo-notification-channel

```

### Setting up the Expo service

[](#setting-up-the-expo-service)

If you use an [Expo Access Token](https://docs.expo.io/push-notifications/sending-notifications/#additional-security) please set this in your environment.

```
EXPO_ACCESS_TOKEN=mysecrettoken

```

Usage
-----

[](#usage)

Firstly you will need to define a method to retrieve your Expo push token

```
class NotifiableModel extends Model {
    // You may pass a single token
    public function routeNotificationForExpo($notification)
    {
        return "ExponentPushToken[xxxxxxxxxxxxxxxxxxxxxx]"
    }

    // Or you may return an array of tokens, for example, a user could have multiple devices.
    public function routeNotificationForExpo($notification)
    {
        return $this->installations->pluck('expo_token')->toArray()
    }
}
```

```
