PHPackages                             dcodegroup/laravel-myob-oauth - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. dcodegroup/laravel-myob-oauth

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

dcodegroup/laravel-myob-oauth
=============================

Simple package which dcode uses to handle the connection to MYOB for all projects. Provides endpoints for UI and callbacks for MYOB

0.1.8(2y ago)13.0k1MITPHPPHP ^8.0|^8.1

Since Jan 14Pushed 1y ago5 watchersCompare

[ Source](https://github.com/DCODE-GROUP/laravel-myob-oauth)[ Packagist](https://packagist.org/packages/dcodegroup/laravel-myob-oauth)[ RSS](/packages/dcodegroup-laravel-myob-oauth/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (9)Dependencies (4)Versions (10)Used By (1)

Laravel MYOB
============

[](#laravel-myob)

This package provides the standard MYOB connection functionality used in most projects.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require dcodegroup/laravel-myob-oauth
```

Then run the install command.

```
php artsian laravel-myob:install
```

This will publish the configuration file and the migration file.

Run the migrations

```
php artsian migrate
```

Configuration
-------------

[](#configuration)

Most of configuration has been set the fair defaults. However you can review the configuration file at `config/laravel-myob-oauth.php` and adjust as needed

Usage
-----

[](#usage)

The package provides an endpoints which you can use. See the full list by running

```
php artsian route:list --name=myob
```

```
+--------+----------+-------------------------+--------------------+-------------------------------------------------------------------------+----------------------------------+
| Domain | Method   | URI                     | Name               | Action                                                                  | Middleware                       |
+--------+----------+-------------------------+--------------------+-------------------------------------------------------------------------+----------------------------------+
|        | GET|HEAD | myob                    | myob.index         | Dcodegroup\LaravelMyobOauth\Http\Controllers\XeroController             | web                              |
|        |          |                         |                    |                                                                         | App\Http\Middleware\Authenticate |
|        | GET|HEAD | myob/auth               | xero.auth          | Dcodegroup\LaravelMyobOauth\Http\Controllers\XeroAuthController         | web                              |
|        |          |                         |                    |                                                                         | App\Http\Middleware\Authenticate |
|        | GET|HEAD | myob/callback           | xero.callback      | Dcodegroup\LaravelMyobOauth\Http\Controllers\XeroCallbackController     | web                              |
|        |          |                         |                    |                                                                         | App\Http\Middleware\Authenticate |
|        | POST     | myob/tenants/{tenantId} | xero.tenant.update | Dcodegroup\LaravelMyobOauth\Http\Controllers\SwitchXeroTenantController | web                              |
|        |          |                         |                    |                                                                         | App\Http\Middleware\Authenticate |
+--------+----------+-------------------------+--------------------+-------------------------------------------------------------------------+----------------------------------+

```

More Information

`example.com/myob` Which is where you will generate the link to authorise MYOB. This is by default protected auth middleware but you can modify in the configuration. This is where you want to link to in your admin and possibly a new window

`example.com/myob/callback` This is the route for which xero will redirect back tp after the oauth has occurred. This is excluded from the middleware auth. You can change this list in the configuration also.

BaseMyobService
---------------

[](#basemyobservice)

The package has a `BaseMyobService` class located at `Dcodegroup\LaravelMyobOauth\BaseMyobService`

So your application should have its own MyobService extend this base class as the initialisation is already done.

```
