2017 © Pedro Peláez
 

library laravel-xero

Xero Service Provider for Laravel 4

image

latheesan-k/laravel-xero

Xero Service Provider for Laravel 4

  • Thursday, December 4, 2014
  • by latheesan-k
  • Repository
  • 1 Watchers
  • 2 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Xero Service Provider for Laravel 4

Originally forked from https://github.com/VentureCraft/xero-laravel and updated to support newer API features (e.g. ContactGroups and paging results etc...)., (*1)

A simple Laravel 4 service provider for including the PHP Xero API., (*2)

Installation

The Xero Service Provider can be installed via Composer by requiring the latheesan-k/laravel-xero package and setting the minimum-stability to dev in your project's composer.json., (*3)

{
    "require": {
        "laravel/framework": "4.0.*",
        "latheesan-k/laravel-xero": "dev-master"
    },
    "minimum-stability": "dev"
}

Usage

To use the Xero Service Provider, you must register the provider when bootstrapping your Laravel application., (*4)

Use Laravel Configuration

Create a new app/config/xero.php configuration file with the following options:, (*5)

return array(
    'key'           => '<your-xero-key>',
    'secret'        => '<your-xero-secret>',
    'publicPath'    => app_path() .'/config/xero/publickey.cer',
    'privatePath'   => app_path() .'/config/xero/privatekey.pem'
);

Find the providers key in app/config/app.php and register the Xero Service Provider., (*6)

    'providers' => array(
        // ...
        'Latheesan\LaravelXero\LaravelXeroServiceProvider',
    )

Find the aliases key in app/config/app.php and add in our LaravelXero alias., (*7)

    'aliases' => array(
        // ...
        'LaravelXero'     => 'Latheesan\LaravelXero\Facades\LaravelXero',
    )

Setting up the application

Create public and private keys, and save them in /app/config/xero/ as publickey.cer and privatekey.pem., (*8)

For more info on setting up your keys, check out the Xero documentation, (*9)

Example Usage

Create a Contact in Xero, (*10)

$contact = array(
    array(
        "Name"        => 'Company Name Ltd',
        "FirstName"   => 'John',
        "LastName"    => 'Doe',
    )
);

$xero_contact = LaravelXero::Contacts($contact);

GET Contacts with WHERE clause & Paging, (*11)

$where = "ContactNumber!=null&IsCustomer=true";
$page  = 1;

print_r(LaravelXero::Contacts(false, false, $where, false, $page));

Reference

The Versions

04/12 2014

dev-master

9999999-dev

Xero Service Provider for Laravel 4

  Sources   Download

MIT

The Requires

 

by Chris Duell
by Latheesan Kanesamoorthy

laravel laravel 4 xero xero api laravel xero