PHP code example of spinen / laravel-quickbooks-client

1. Go to this page and download the library: Download spinen/laravel-quickbooks-client library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

spinen / laravel-quickbooks-client example snippets


class User extends Authenticatable
{
    use Notifiable, HasQuickBooksToken;

php artisan tinker
Psy Shell v0.8.17 (PHP 7.1.14 — cli) by Justin Hileman
>>> Auth::logInUsingId(1)
=> App\Models\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
   }
>>>

Route::view('some/route/needing/quickbooks/token/before/using', 'some.view')
     ->middleware('quickbooks');
bash
$ php artisan migrate --package=spinen/laravel-quickbooks-client
configs/quickbooks.php
quickbooks.php
bash
    php artisan vendor:publish --tag=quickbooks-config
    
bash
    php artisan vendor:publish --tag=quickbooks-views