zephia / laravel-pilot by mauro-moreno

This package is a wrapper of Pilot CRM API Client PHP Class for Laravel Framework.
565
0
3
Package Data
Maintainer Username: mauro-moreno
Maintainer Contact: djpepa@hotmail.com (Cristian Jimenez)
Package Create Date: 2016-08-16
Package Last Update: 2016-08-17
Language: PHP
License: MIT
Last Refreshed: 2024-03-24 03:08:49
Package Statistics
Total Downloads: 565
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 0
Total Watchers: 3
Total Forks: 0
Total Open Issues: 0

laravel-pilot

This package is a wrapper of Pilot CRM API Client PHP Class for Laravel Framework.

Installation

Run the following command and provide the latest stable version:

composer require zephia/laravel-pilot

Then register this service provider with Laravel in config/app.php:

'providers' => [
    ...
    Zephia\LaravelPilot\LaravelPilotServiceProvider::class,
    ...
]

Publish config file:

php artisan vendor:publish --provider="Zephia\LaravelPilot\LaravelPilotServiceProvider" --tag="config"

Add PILOT_APP_KEY and PILOT_API_DEBUG constants to your .env file:

PILOT_APP_KEY=YOUR-PILOT-APP-KEY
PILOT_API_DEBUG=false

Usage

Create and store lead

See fields documentation at official Pilot API reference

<?php

/**
 * Create Lead
 */

// From array (field names without "pilot_" prefix)
$lead_data = new \Zephia\PilotApiClient\Model\LeadData([
    'business_type_id' => 1,
    'contact_type_id' => 1,
    'suborigin_id' => 'FFFF0000',
    'firstname' => 'John',
    'lastname' = 'Doe',
    'phone' => '+543512345678',
    'email' => 'john.doe@domain.com'
]);

// Using setters (camelcase)
$lead_data = new \Zephia\PilotApiClient\Model\LeadData();
$lead_data->setBusinessTypeId(1);
$lead_data->setContactTypeId(1);
$lead_data->setSuboriginId('FFFF0000');
$lead_data->setFirstName('John');
$lead_data->setLastName('Doe');
$lead_data->setPhone('+543512345678');
$lead_data->setEmail('john.doe@domain.com');

/**
 * Store Lead
 */
$pilot = app('pilot')->storeLead($lead_data);

// Returns API response object.