wallstreetio/laravel-ontraport

A Laravel package to easily integrate the Ontraport API.

v1.0.3 2019-12-01 00:41 UTC

README

Build Status Software License Latest Version

Laravel Ontraport API is simply a Laravel bridge for the Ontraport API.

Installation

composer require wallstreetio/laravel-ontraport

Configuration

Add \Wsio\Ontraport\OntraportServiceProvider to your providers list in config/app.php file.

    'providers' => [
        Wsio\Ontraport\OntraportServiceProvider::class,
    ]

Optionally, you may also add the Ontraport facade to your aliases list.

    'aliases' => [
        'OAP' => Wsio\Ontraport\Facade\Ontraport::class,
    ]

Publish the configuration file.

php artisan vendor:publish --provider="Wsio\Ontraport\OntraportServiceProvider"

Add your Ontraport ONTRAPORT_APP_ID and ONTRAPORT_API_KEY to your .env file.

ONTRAPORT_APP_ID="your-ontraport-app-id"
ONTRAPORT_API_KEY="your-ontraport-api-key"

Usage

public function index(\Wsio\Ontraport\Ontraport $ontraport)
{
    return $ontraport->contacts->get();
}

Or using the facade

public function show($id)
{
    return OAP::contacts()->find($id);
}

For full documentation, please refer to the Ontraport API package.

License

WallStreet.io Laravel Ontraport API is open-sourced software licensed under The MIT License (MIT).