2017 © Pedro Peláez
 

library laravel-quickbooks-client

SPINEN's Laravel Client for QuickBooks.

image

spinen/laravel-quickbooks-client

SPINEN's Laravel Client for QuickBooks.

  • Thursday, April 19, 2018
  • by david.mathews
  • Repository
  • 7 Watchers
  • 2 Stars
  • 381 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 55 % Grown

The README.md

SPINEN's Laravel QuickBooks Client

Latest Stable Version Latest Unstable Version Total Downloads License, (*1)

PHP client wrapping the QuickBooks PHP SDK., (*2)

We solely use Laravel for our applications, so this package is written with Laravel in mind. If there is a request from the community to split this package into 2 parts to allow it to be used outside of Laravel, then we will consider doing that work., (*3)

Build Status

Branch Status Coverage Code Quality
Develop Build Status Code Coverage Scrutinizer Code Quality
Master Build Status Code Coverage Scrutinizer Code Quality

Installation

  1. Install QuickBooks PHP Client:
$ composer require spinen/laravel-quickbooks-client
  1. Run our migration to install the quickbooks_tokens table:
$ php artisan migrate --package=spinen/laravel-quickbooks-client

The package uses the auto registration feature of Laravel., (*4)

Configuration

  1. You will need a quickBooksToken relationship on your User model. There is a trait named Spinen\QuickBooks\HasQuickBooksToken, which you can include on your User model, which will setup the relationship. To do this implement the following:

Add use Spinen\QuickBooks\HasQuickBooksToken; to your service container at the top of User.php and also add the trait within the class. For example:, (*5)

class User extends Authenticatable
{
    use Notifiable, HasQuickBooksToken;

NOTE: If your User model is not App/User, then you will need to configure the path in the configs/quickbooks.php as documented below., (*6)

  1. Add the appropriate values to your .env, (*7)

    Minimal Keys

    QUICKBOOKS_CLIENT_ID=<client id given by QuickBooks>
    QUICKBOOKS_CLIENT_SECRET=<client secret>
    

    Optional Keys

    QUICKBOOKS_API_URL=<Development|Production> # Defaults to App's env value
    QUICKBOOKS_DEBUG=<true|false>               # Defaults to App's debug value
    
  2. [Optional] Publish configs & views, (*8)

    Config

    A configuration file named quickbooks.php can be published to config/ by running..., (*9)

    php artisan vendor:publish --tag=quickbooks-config
    

    Views

    View files can be published by running..., (*10)

    php artisan vendor:publish --tag=quickbooks-views
    

Usage

Here is an example of getting the company information from QuickBooks:, (*11)

NOTE: Before doing these commands, go to your connect route (default: /quickbooks/connect) to get a QuickBooks token for your user

php artisan tinker
Psy Shell v0.8.17 (PHP 7.1.14 — cli) by Justin Hileman
>>> Auth::logInUsingId(1)
=> App\User {#1668
     id: 1,
     // Other keys removed for example
   }
>>> $quickbooks = app('Spinen\QuickBooks\Client') // or app('QuickBooks')
=> Spinen\QuickBooks\Client {#1613}
>>> $quickbooks->getDataService()->getCompanyInfo();
=> QuickBooksOnline\API\Data\IPPCompanyInfo {#1673
     +CompanyName: "Sandbox Company_US_1",
     +LegalName: "Sandbox Company_US_1",
     // Other properties removed for example
   }
>>>

You can call any of the resources as documented in the SDK., (*12)

Middleware

If you have routes that will be dependent on the user's account having a usable QuickBooks OAuth token, there is an included middleware Spinen\QuickBooks\Laravel\Filter that gets registered as quickbooks that will ensure the account is linked and redirect them to the connect route if needed., (*13)

Here is an example route definition:, (*14)

Route::view('some/route/needing/quickbooks/token/before/using', 'some.view')
     ->middleware('quickbooks');

The Versions

19/04 2018

dev-develop

dev-develop

SPINEN's Laravel Client for QuickBooks.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jimmy Puckett

laravel client quickbooks spinen

19/04 2018

dev-master

9999999-dev

SPINEN's Laravel Client for QuickBooks.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jimmy Puckett

laravel client quickbooks spinen

19/04 2018
19/04 2018

dev-feature/correctLogPath

dev-feature/correctLogPath

SPINEN's Laravel Client for QuickBooks.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jimmy Puckett

laravel client quickbooks spinen

22/03 2018
22/03 2018

dev-feature/addMethodToReturnReportService

dev-feature/addMethodToReturnReportService

SPINEN's Laravel Client for QuickBooks.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jimmy Puckett

laravel client quickbooks spinen

21/03 2018