A service provider and facade to set up and use the SendPulse PHP library in Laravel 5.
This package consists of a service provider, which binds an instance of an initialized SendPulse client to the IoC-container and a SendPulse facade so you may access all methods of the Sendpulse\RestAPI\ApiClient class via the syntax:
$message = ['title' => 'My first notification', 'website_id' => 1, 'body' => 'I am the body of the push message'];
SendPulse::createPushTask($message);
You should refer to the SendPulse API and underlying SendPulseApi PHP class for full details about all available methods.
-
Install the 'dvomaks/laravel-sendpulse' package
Note, this will also install the required sendpulse/rest-api package.
$ composer require dvomaks/laravel-sendpulse dev-master
-
Update 'config/app.php'
# Add `SendPulseLaravelServiceProvider` to the `providers` array 'providers' => array( ... 'Dvomaks\LaravelSendPulse\SendPulseServiceProvider', ) # Add the `SendPushFacade` to the `aliases` array 'aliases' => array( ... 'SendPulse' => 'Dvomaks\LaravelSendPulse\SendPulseFacade', )
-
Publish the configuration file (creates sendpulse.php in config directory) and add your API keys and optional default settings.
$ php artisan vendor:publish