dvomaks/laravel-sendpulse

A minimal service provider to set up and use the SendPulse PHP library in Laravel 5

dev-master 2021-11-29 17:14 UTC

This package is auto-updated.

Last update: 2024-03-29 04:26:27 UTC


README

CircleCI

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.

Setup

  1. Install the 'dvomaks/laravel-sendpulse' package

    Note, this will also install the required sendpulse/rest-api package.

    $ composer require dvomaks/laravel-sendpulse dev-master
  2. 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',
    )
  3. Publish the configuration file (creates sendpulse.php in config directory) and add your API keys and optional default settings.

    $ php artisan vendor:publish