Download the PHP package lepresk/laravel-onesignal without Composer
On this page you can find all versions of the php package lepresk/laravel-onesignal. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download lepresk/laravel-onesignal
More information about lepresk/laravel-onesignal
Files in lepresk/laravel-onesignal
Package laravel-onesignal
Short Description OneSignal push notification channel for Laravel. Send mobile and web push notifications through OneSignal API with support for iOS, Android, and web browsers.
License MIT
Homepage https://github.com/lepresk/laravel-onesignal
Informations about the package laravel-onesignal
Laravel OneSignal
OneSignal notification channel for Laravel applications. Send push notifications to iOS, Android, and web browsers through OneSignal's API with a clean, fluent interface.
Features
- Laravel Notification Channel integration
- Fluent message builder API
- Event system for notification lifecycle
- Comprehensive configuration options
- Custom exception handling
- PSR-3 logging support
- Type-safe implementation with PHP 8.3
- Full test coverage
Requirements
- PHP 8.3 or higher
- Laravel 11.0 or 12.0
- OneSignal account and API credentials
Installation
Install the package via Composer:
The service provider will be automatically registered through Laravel's package auto-discovery.
Publish Configuration
Publish the configuration file to customize package behavior:
Environment Configuration
Add your OneSignal credentials to your .env file:
Usage
Basic Usage with Facade
Using Laravel Notifications
Create a notification class:
Send the notification:
Building Messages
Multi-language Support
Priority Settings
Targeting Users
External User IDs
External User IDs are custom identifiers you assign to your users in OneSignal. They map your application's user IDs to OneSignal player IDs, allowing you to send notifications to specific users without tracking OneSignal's internal player IDs.
Segments
Segments are groups of users defined in your OneSignal dashboard based on various criteria.
Tags
Tags are key-value pairs you set on user devices to create custom targeting rules.
Custom Data
Images and Buttons
The third parameter in addButton() is optional and specifies the URL to open when the button is clicked.
Advanced Options
Event Listeners
Listen to notification lifecycle events:
Example listener implementation:
Configuration
The package provides extensive configuration options in config/onesignal.php:
Default Values
The package applies default values from the configuration file. These defaults are used only when values are not explicitly set on the message.
Testing
Run the test suite:
Run tests with coverage:
Code Quality
Format code with Laravel Pint:
Run static analysis with PHPStan:
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security-related issues, please email [email protected] instead of using the issue tracker.
Credits
- lepresk
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-onesignal with dependencies
ext-json Version *
illuminate/contracts Version ^11.0|^12.0
illuminate/support Version ^11.0|^12.0
illuminate/notifications Version ^11.0|^12.0
norkunas/onesignal-php-api Version ^2.15
nyholm/psr7 Version ^1.8
symfony/http-client Version ^7.1
psr/log Version ^3.0