A handy Laravel Wrapper around using MYOB Account Right v2
Branch: master
Clone or download
Latest commit ccc6360 Feb 10, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
config initial commit Feb 2, 2019
database/migrations wip Feb 3, 2019
src create customer Feb 9, 2019
tests initial commit Feb 2, 2019
.editorconfig initial commit Feb 2, 2019
.gitattributes initial commit Feb 2, 2019
.gitignore initial commit Feb 2, 2019
.scrutinizer.yml initial commit Feb 2, 2019
.styleci.yml initial commit Feb 2, 2019
.travis.yml initial commit Feb 2, 2019
CHANGELOG.md initial commit Feb 2, 2019
CONTRIBUTING.md initial commit Feb 2, 2019
LICENSE.md initial commit Feb 2, 2019
README.md readme updates Feb 9, 2019
composer.json Update composer.json Feb 4, 2019
phpunit.xml.dist initial commit Feb 2, 2019


Laramyob - MYOB in Laravel, made easy.

Latest Version on Packagist Build Status Quality Score Total Downloads

A handy Laravel wrapper around MYOB AccountRight v2. This is still in alpha stage and will include breaking changes regularily. Full Readme in progress.


You can install the package via composer:

composer require creativecurtis/laramyob


ENV requirements:


Publish the preset configuration to store your MYOB authentication details

php artisan vendor:publish --provider="Creativecurtis\Laramyob\LaramyobServiceProvider" --tag="migrations"
php artisan migrate

You'll now need to authenticate with something like the following:

use Creativecurtis\Laramyob\Laramyob;
use Creativecurtis\Laramyob\Models\Remote\CompanyFile;
use Creativecurtis\Laramyob\Models\Remote\Contact\Customer;

$laramyob = new Laramyob;
//Redirect your user to MYOB to authenticate account right v2
//When the code is returned, get your access token
//Now you can save your credentials like so
//You would first load the company files the MYOB user has access to
//Then save them like so (the username and passwords are Base64 encoded in Laramyob)
        'username' => 'Administrator',
        'password' => '',
        'company_file_guid' => '8bf1611b-1666-4f8f-8b7f-ee4cf4fee2ff',
        'company_file_name' => 'API Sandbox Demo 48',
        'company_file_uri'  => 'https:\/\/ar1.api.myob.com\/accountright\/8bf1611b-1666-4f8f-8b7f-ee4cf4fee2ff'



Once that's completed you'll be able to query the API as you normally would

//And now query the API with the supported models (and paginate if supported)
$laramyob->of(Customer::class)->page(1); //page 1
//Or (if the Model is a paginted model it will stil default to pagination due to MYOB api restrictions)
$laramyob->of(Customer::class)->load(); //page 1
$laramyob->of(Customer::class)->load(2); //page 2

//You can also load the specified model by UID

//Or just return the first from a search

//The customer class also has some helper function (whereEmail)

You can also expose the Raw API for MYOB if appropriate

$laramyob->rawPost('/Contact/Employee', $data);


Once you're ready to post you can do the following, to, for example, save a Customer

$taxCode = $this->laramyob->of(TaxCode::class)->whereCode('GST')->first();

$customer = (new Customer)->create([
    'CompanyName'    => 'Creativecurtis',
    'LastName'       => 'curtis',
    'FirstName'      => 'luke',
    'IsIndividual'   => false,
    "TaxCode"        => [
        "UID" => $taxCode['UID'],
    "FreightTaxCode" => [
        "UID" => $taxCode['UID'],



composer test


  • Create API Auth.
  • Create basic model syntax for retrieving data
  • Implement base model for encodable data
  • Create request class
  • Clean up request class.
  • Create get and set for appropriate models instead of current free-for-all
  • Write tests
  • Make OAuth2 request class less dependant on request class


Please see CHANGELOG for more information what has changed recently.


Please see CONTRIBUTING for details.


If you discover any security related issues, please email lukesimoncurtis@gmail.com instead of using the issue tracker.



The MIT License (MIT). Please see License File for more information.

Laravel Package Boilerplate

This package was generated using the Laravel Package Boilerplate.