dev-master
9999999-devXero Service Provider for Laravel 4
MIT
The Requires
- php >=5.3.0
- illuminate/support 4.*
by Chris Duell
laravel laravel 4 xero
Xero Service Provider for Laravel 4
Originally forked from https://github.com/Softlabs/xero-laravel, (*1)
A simple Laravel 4 service provider for including the PHP Xero API., (*2)
The Xero Service Provider can be installed via Composer by requiring the Venturecraft/xero-laravel
package and setting the minimum-stability
to dev
in your project's composer.json
., (*3)
{ "require": { "laravel/framework": "4.0.*", "venturecraft/xero-laravel": "dev-master" }, "minimum-stability": "dev" }
To use the Xero Service Provider, you must register the provider when bootstrapping your Laravel application., (*4)
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/config/xero/publickey.cer', 'privatePath' => '../app/config/xero/privatekey.pem' );
Find the providers
key in app/config/app.php
and register the Xero Service Provider., (*6)
'providers' => array( // ... 'Venturecraft\XeroLaravel\XeroLaravelServiceProvider', )
Find the aliases
key in app/config/app.php
and add in our Xero
alias., (*7)
'aliases' => array( // ... 'XeroLaravel' => 'Venturecraft\XeroLaravel\Facades\XeroLaravel', )
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)
Create Contact, (*10)
$contact = array( array( "Name" => $user['company']['name'], "FirstName" => $user['firstname'], "LastName" => $user['surname'], ) ); $xero_contact = XeroLaravel::Contacts($contact);
Get Contacts with WHERE clause & paging, (*11)
$where = "ContactNumber!=null&IsCustomer=true"; $page = 1; print_r(XeroLaravel::Contacts(false, false, $where, false, $page));
Xero Service Provider for Laravel 4
MIT
laravel laravel 4 xero