viecngay / larasignal
:description
2.0.1
2019-01-07 06:32 UTC
Requires
Requires (Dev)
- mockery/mockery: ^1.1
- orchestra/testbench: ~3.0
- phpunit/phpunit: ~7.0
- sempro/phpunit-pretty-print: ^1.0
README
#LaraSignal Working with onesignal easier!
Installation
Via Composer
$ composer require viecngay/larasignal
Register the service provider and alias in your config/app.php:
'providers' => [ ... ViecNgay\LaraSignal\LaraSignalServiceProvider::class, ], 'aliases' => [ ... 'LaraSignal' => ViecNgay\LaraSignal\Facades\LaraSignal::class ],
Config APP ID and REST API KEY in you .env file
ONE_SIGNAL_APP_ID=Your Onesignal App Id ONE_SIGNAL_REST_API_KEY=Your Onesignal Rest Api Key
Usage
Send notification to segment
LaraSignal::sendToSegments($segments = [], $title = 'Title', $subTitle = 'Default Subtitle', $payload = [], $options = [])
Send notification to Player
LaraSignal::sendToDevice($deviceIds = [], $title = 'Title', $subTitle = 'Default Subtitle', $payload = [], $options = [])
See option list here https://documentation.onesignal.com/v5.0/reference
Contributing
Please see contributing.md for details and a todolist.
Credits
License
license. Please see the license file for more information.