viecngay/larasignal

2.0.1 2019-01-07 06:32 UTC

This package is auto-updated.

Last update: 2024-04-19 18:32:25 UTC


README

Latest Version on Packagist Total Downloads Build Status

#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.