https://github.com/yieldstudio/laravel-expo-notifier
Easily manage Expo notifications with Laravel. Support batched notifications.
https://github.com/yieldstudio/laravel-expo-notifier
batch expo laravel notifier push-notifications queue
Last synced: 8 months ago
JSON representation
Easily manage Expo notifications with Laravel. Support batched notifications.
- Host: GitHub
- URL: https://github.com/yieldstudio/laravel-expo-notifier
- Owner: YieldStudio
- License: mit
- Created: 2022-11-16T08:40:03.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-04-09T14:54:54.000Z (about 1 year ago)
- Last Synced: 2025-09-05T20:03:30.981Z (9 months ago)
- Topics: batch, expo, laravel, notifier, push-notifications, queue
- Language: PHP
- Homepage:
- Size: 148 KB
- Stars: 52
- Watchers: 4
- Forks: 21
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# laravel-expo-notifier
Easily manage Expo notifications with Laravel. Support batched notifications.
[](https://github.com/yieldstudio/laravel-expo-notifier/releases)
[](https://github.com/yieldstudio/laravel-expo-notifier/actions/workflows/tests.yml)
[](https://packagist.org/packages/yieldstudio/laravel-expo-notifier)
> Major version zero (0.y.z) is for initial development. Anything MAY change at any time. The public API SHOULD NOT be considered stable.
## Installation
composer require yieldstudio/laravel-expo-notifier
## Configure
You must publish the configuration file with:
```shell
php artisan vendor:publish --provider="YieldStudio\LaravelExpoNotifier\ExpoNotificationsServiceProvider" --tag="expo-notifications-config" --tag="expo-notifications-migration"
```
### Available environment variables
- `EXPO_PUSH_NOTIFICATIONS_PER_REQUEST_LIMIT` : sets the max notifications sent on a bulk request. [The official documentation says the limit should be 100](https://docs.expo.dev/push-notifications/sending-notifications/#request-errors) but in fact it's failing. You can tweak it by setting a value under 100.
- `EXPO_NOTIFICATIONS_ACCESS_TOKEN` : sets the Expo access token used to send notifications with an [additional layer of security](https://docs.expo.dev/push-notifications/sending-notifications/#additional-security). You can get your access token from [your Expo dashboard](https://expo.dev/accounts/[account]/settings/access-tokens).
## Usage
### Send notification
```php
to([$notifiable->expoTokens->value])
->title('A beautiful title')
->body('This is a content')
->channelId('default');
}
}
```
### Commands usage
Send database pending notifications
```
php artisan expo:notifications:send
```
Clean tickets from outdated tokens
```
php artisan expo:tickets:check
```
You may create schedules to execute these commands.
### Batch support
You can send notification in the next batch :
```php
(new ExpoMessage())
->to([$notifiable->expoTokens->value])
->title('A beautiful title')
->body('This is a content')
->channelId('default')
->shouldBatch();
```
Don't forget to schedule the `expo:notifications:send` command.
## Unit tests
To run the tests, just run `composer install` and `composer test`.
## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
## Contributing
Please see [CONTRIBUTING](https://raw.githubusercontent.com/YieldStudio/.github/main/CONTRIBUTING.md) for details.
### Security
If you've found a bug regarding security please mail [contact@yieldstudio.fr](mailto:contact@yieldstudio.fr) instead of using the issue tracker.
## Credits
- [David Tang](https://github.com/dtangdev)
- [James Hemery](https://github.com/jameshemery)
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.