Download the PHP package shokme/laravel-onesignal without Composer
On this page you can find all versions of the php package shokme/laravel-onesignal. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-onesignal
Laravel OneSignal
The shokme/laravel-onesignal
package provides easy to use facade to send notification to your users via onesignal.
It uses the latest functionality of PHP8.1
.
Here's a demo of how you can use it:
Find below the documentation of all available methods.
Installation
You can install the package via composer:
define environment variables:
You may want to publish the config file to update http timeout and retry:
Documentation
Message
You can use a string or array of language to set the message(title,subtitle,contents).
If you set a string
, it will be set to 'en' for default language.
Url
You can set the url to open when user click the notification.
Buttons
Mobile
Web
Additional Parameters
If you have to use some parameters that are not supported by the package, you can set them using this method:
Schedule and Delay
You can read the OneSignal documentation for more information.
Schedule
is equal to send_after
parameter.
Delay
is equal to delayed_option
parameter, if timezone
is set you need to set the second arguments($time
).
Channels
When using only one channel.
When using multiple channel.
Filters
You can see Available Filters.\ If you want to know how to Format Filters.
or you can chain filter, watch out in some case you may need to combine with filters()
because some fields aren't supported at the moment.
Sending Notification
You can send multiple kind of notification.
By default, the notification use the push
channel.
Notifications
Retrieve all
You can retrieve all notifications using:
Retrieve one
You can add a second argument to specify your $outcomes
.
Check the OneSignal outcomes documentation.
Cancel
Player
OneSignal Device documentation
Add
All device type can be found in Shokme\OneSignal\Enum\DeviceType.php.
Edit
Contribution
This package might not be complete as it is made for personal use. If you want to contribute, please feel free to open an issue or pull request.