All Projects → spinen → laravel-quickbooks-client

spinen / laravel-quickbooks-client

Licence: other
SPINEN's Laravel Client for QuickBooks.

Programming Languages

PHP
23972 projects - #3 most used programming language
Blade
752 projects

Projects that are alternatives of or similar to laravel-quickbooks-client

nodejs-searchitunes
Lightweight node.js module to quickly search Apple's iTunes Store for music, movies, apps, etc.
Stars: ✭ 25 (+0%)
Mutual labels:  api-client
pocket-api
A python wrapper around GetPocket API V3.
Stars: ✭ 103 (+312%)
Mutual labels:  api-client
pychannels
Python library for querying and controlling the Channels app.
Stars: ✭ 15 (-40%)
Mutual labels:  api-client
simple-php-api
An extremely simple API (with authentication) example, written in PHP (server) and JS (client), using JSON
Stars: ✭ 23 (-8%)
Mutual labels:  api-client
pushover
Go wrapper for the Pushover API
Stars: ✭ 112 (+348%)
Mutual labels:  api-client
downcloud
Download your own Soundcloud tracks (uncompressed)
Stars: ✭ 22 (-12%)
Mutual labels:  api-client
cv4pve-api-dotnet
Proxmox VE Client API .Net C#
Stars: ✭ 25 (+0%)
Mutual labels:  api-client
messaging-apis
Messaging APIs for multi-platform
Stars: ✭ 1,759 (+6936%)
Mutual labels:  api-client
laravel-garbage-man
Scheduled job to clean out Laravel's soft deleted records at configured interval
Stars: ✭ 33 (+32%)
Mutual labels:  spinen
keen-analysis.js
A light JavaScript client for Keen
Stars: ✭ 40 (+60%)
Mutual labels:  api-client
ynab.go
Go client for the YNAB API. Unofficial. It covers 100% of the resources made available by the YNAB API.
Stars: ✭ 49 (+96%)
Mutual labels:  api-client
nzb
Get Things Done® with nzb, a beautiful terminal interface for Nozbe. Inspired by Wunderline
Stars: ✭ 35 (+40%)
Mutual labels:  api-client
dns
dns is a simple CLI tool for DNS-LG API
Stars: ✭ 28 (+12%)
Mutual labels:  api-client
Taviloglu.Wrike.ApiClient
.NET Client for Wrike API
Stars: ✭ 24 (-4%)
Mutual labels:  api-client
js-http-client
[DEPRECATED] Official Textile JS HTTP Wrapper Client
Stars: ✭ 29 (+16%)
Mutual labels:  api-client
fetch
Isomorphic Wordpress API client and React hooks - super tiny, super fast.
Stars: ✭ 47 (+88%)
Mutual labels:  api-client
CompaniesHouse.NET
A simple .NET client wrapper for CompaniesHouse API
Stars: ✭ 28 (+12%)
Mutual labels:  api-client
revolut-php
💳 PHP Bindings for the Revolut Business API
Stars: ✭ 37 (+48%)
Mutual labels:  api-client
hcloud-rust
Unofficial Rust crate for accessing the Hetzner Cloud API
Stars: ✭ 22 (-12%)
Mutual labels:  api-client
tweetsOLAPing
implementing an end-to-end tweets ETL/Analysis pipeline.
Stars: ✭ 24 (-4%)
Mutual labels:  api-client

SPINEN's Laravel QuickBooks Client

Latest Stable Version Latest Unstable Version Total Downloads License

PHP client wrapping the QuickBooks PHP SDK.

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.

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.

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:

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.

  1. Add the appropriate values to your .env

    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

    Config

    A configuration file named quickbooks.php can be published to config/ by running...

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

    Views

    View files can be published by running...

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

Usage

Here is an example of getting the company information from QuickBooks:

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.

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.

Here is an example route definition:

Route::view('some/route/needing/quickbooks/token/before/using', 'some.view')
     ->middleware('quickbooks');
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].