Skip to content
Paul edited this page Aug 29, 2017 · 1 revision

Notes on using with Lumen

Config

Lumen doesn't ship in quite the same was as the full-blown Laravel, so to get up and running quickly you need to:

  1. Change bootstrap/app.php to include:
$app->withFacades(true, [
	'DrawMyAttention\XeroLaravel\Facades\XeroPrivate' => 'XeroPrivate',
]);
  1. After registering middleware, you need to register the service provider in the same file (bootstrap/app.php): $app->register(DrawMyAttention\XeroLaravel\Providers\XeroServiceProvider::class);
  2. Add a new directory to your config directory, name it xero, pop a new file in here called config.php, so it ends up as config/xero/config.php
  3. The contents of config.php comes from this repository, and you can find the file here: https://github.com/amochohan/xerolaravel/blob/master/config.php [https://github.com/amochohan/xerolaravel]

Using the class

I've found if i inject \Laravel\Lumen\Application into my method i can then simply use the library like so:

$xero = $app->make('XeroPrivate');
$invoices = $xero->load('Accounting\\Invoice')->execute();
Clone this wiki locally