View on GitHub

laravel-xero-oauth2

A Laravel integration for Xero using the Oauth 2.0 spec

Using the Package

This package registers two bindings into the service container you’ll be interested in:

Scopes

You’ll want to set the scopes required for your application in the config file.

The default set of scopes are openid, email, profile, offline_access, and accounting.settings. You can see all available scopes on the official Xero documentation.

Example calls

This package is simply a bridge so you don’t have to deal with the Oauth2 gymnastics in Laravel.

Once you’ve an instance of \XeroAPI\XeroPHP\Api\AccountingApi::class you’re dealing directly with Xero’s api library.

The XeroAPI PHP Oauth2 App repository has this list of examples of implementing calls to the API: e.g. invoice creation etc.

https://github.com/XeroAPI/xero-php-oauth2-app/blob/master/example.php