Looking to hire Laravel developers? Try LaraJobs

sendpulse-laravel maintained by artjoker

Description
SendPulse REST API client for Laravel
Last update
2022/04/02 18:00 (dev-master)
License
Downloads
54

Comments
comments powered by Disqus

Sendpulse API for Laravel

Sendpulse API package for Laravel

Installation

composer require artjoker/sendpulse-laravel

Add Artjoker\SendpulseLaravel\SendPulseProvider::class to providers

config/app.php

'providers' => [
    Artjoker\SendpulseLaravel\SendPulseProvider::class,
],

'aliases' => [
    'SendPulse' => Artjoker\SendpulseLaravel\SendPulse::class,
]

Publish config

php artisan vendor:publish --provider="Artjoker\SendpulseLaravel\SendPulseProvider" --tag="config"

Set the api key variables in your .env file

SENDPULSE_API_USER_ID=null
SENDPULSE_API_SECRET=null

Usage API

https://sendpulse.com/ru/integrations/api

// From container
$api = app('sendpulse-laravel');
$books = $api->listAddressBooks();

// From facade
$books = \SendPulse::listAddressBooks();

// From dependency injection
public function getBooks(\Artjoker\SendpulseLaravel\Contracts\SendPulseApi $api)
{
    $books = $api->listAddressBooks();
}