Download the PHP package subit/expo-laravel without Composer
On this page you can find all versions of the php package subit/expo-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download subit/expo-laravel
More information about subit/expo-laravel
Files in subit/expo-laravel
Package expo-laravel
Short Description Expo notifications driver for Laravel
License MIT
Homepage https://github.com/subit-io/expo-laravel
Informations about the package expo-laravel
Exponent push notifications channel for Laravel
Contents
- Installation
- ExpoMessage options
Installation
You can install the package via composer:
This package supports Laravel 10-13 and will automatically register itself using Package Discovery.
You can publish the migration with:
After publishing the migration you can create the expo_notification_recipients table by running the migrations:
You can optionally publish the config file with:
This is the contents of the published config file:
Usage
ExpoMessage options
| Property | iOS/Android | Type | Description |
|---|---|---|---|
to() |
both | string | An Expo push token specifying the recipient of this message |
jsonData() |
both | string | A JSON object delivered to your app. It may be up to 4KiB |
title() |
both | string | The title to display in the notification |
body() |
both | string | The message to display in the notification |
ttl() |
both | int | Seconds the message may be kept around for redelivery |
expiration() |
both | int | UNIX epoch timestamp. Same effect as ttl. ttl takes precedence |
priority() |
both | Priority | The delivery priority of the message |
subtitle() |
iOS | string | The subtitle to display in the notification below the title |
enableSound() |
iOS | Play a sound when the recipient receives this notification | |
disableSound() |
iOS | Play no sound (default) | |
badge() |
iOS | int | Number to display in the badge on the app icon |
channelId() |
Android | string | Channel through which to display this notification |
For a more detailed description, refer to the Expo documentation https://docs.expo.io/versions/latest/guides/push-notifications/#formats
Managing Recipients
This package registers two endpoints that handle the subscription of recipients, the endpoints are defined in src/Http/routes.php file, used by ExpoController and all loaded through the package service provider.
Routing a message
By default the expo "recipient" messages will be sent to will be defined (besides the id) using the notifiable class as type, for example App\User. However, you can change this behaviour by including a routeNotificationForExpoPushNotifications() in the notifiable class method that returns the recipient type.
All versions of expo-laravel with dependencies
ext-json Version >=7.4
laravel/framework Version ^6.0||^7.0||^8.0||^9.0||^10.0||^11.0||^12.0||^13.0
subit/php-expo-sdk Version >=2.1.0