2017 © Pedro Peláez
 

library sendpulse-laravel

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

image

wensleydale/sendpulse-laravel

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

  • Tuesday, January 19, 2016
  • by garethtdavies
  • Repository
  • 0 Watchers
  • 6 Stars
  • 1,890 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 3 Versions
  • 10 % Grown

The README.md

SendPulse Laravel Helper

A service provider and facade to set up and use the SendPulse PHP library in Laravel 5., (*1)

Build Status, (*2)

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 SendpulseApi class via the syntax:, (*3)

$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 SendPush PHP class for full details about all available methods., (*4)

Setup

  1. Install the 'wensleydale/sendpulse-laravel' package, (*5)

    Note, this will also install the required wensleydale/sendpulse-rest-api-php package., (*6)

    $ composer require wensleydale/sendpulse-laravel:1.*
    
  2. Update 'config/app.php', (*7)

    # Add `SendPulseLaravelServiceProvider` to the `providers` array
    'providers' => array(
        ...
        'SendPulse\SendPulseLaravel\SendPulseLaravelServiceProvider',
    )
    
    # Add the `SendPushFacade` to the `aliases` array
    'aliases' => array(
        ...
        'SendPulse' => 'SendPulse\SendPulseLaravel\SendPulseFacade',
    )
    
  3. Publish the configuration file (creates sendpulse.php in config directory) and add your API keys and optional default settings., (*8)

    $ php artisan vendor:publish
    

Type Hinting

If you do not wish to make use of the SendPulse facade you may simply "type-hint" the SendPulse dependency in the constructor of a class that is resolved by the IoC container and an instantiated client will be ready for use., (*9)

use SendPulse\SendpulseApi;

private $client;

public function __construct(SendpulseApi $client)
{
    $this->client = $client;
}

public function getWebsites()
{
    $this->client->pushListWebsites();
}

The Versions

19/01 2016

dev-master

9999999-dev

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

  Sources   Download

MIT

The Requires

 

The Development Requires

by Gareth Davies

laravel sendpulse

19/01 2016

v1.0.1

1.0.1.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

by Gareth Davies

laravel sendpulse

19/01 2016

v1.0

1.0.0.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

by Gareth Davies

laravel sendpulse