PHPackages                             responsilicious/laravel-quickbooks - 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. [API Development](/categories/api)
4. /
5. responsilicious/laravel-quickbooks

ActiveLibrary[API Development](/categories/api)

responsilicious/laravel-quickbooks
==================================

Laravel Quickbooks integration

0.0.0.3(3y ago)010.7k↓50%MITPHP

Since Feb 14Pushed 3y agoCompare

[ Source](https://github.com/Responsilicious/laravel-quickbooks)[ Packagist](https://packagist.org/packages/responsilicious/laravel-quickbooks)[ Docs](https://github.com/LifeOnScreen/laravel-quickbooks)[ RSS](/packages/responsilicious-laravel-quickbooks/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

laravel-quickbooks
==================

[](#laravel-quickbooks)

[![Latest Version on Packagist](https://camo.githubusercontent.com/c401cdf6e1517912019d68324955e4e8da7d6df8554974c6d121dd8e3f86f1c1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c6966656f6e73637265656e2f6c61726176656c2d717569636b626f6f6b732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lifeonscreen/laravel-quickbooks)[![Total Downloads](https://camo.githubusercontent.com/8bc07286cbf99c16e4ad5ae936224103216b24659b6eba153a71ab9abcd8037d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c6966656f6e73637265656e2f6c61726176656c2d717569636b626f6f6b732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lifeonscreen/laravel-quickbooks)

Take a look at [contributing.md](contributing.md) to see a to do list.

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

[](#installation)

Via Composer

```
$ composer require lifeonscreen/laravel-quickbooks
```

Publish package and run migrations

```
$ php artisan vendor:publish
$ php artisan migrate
```

Usage
-----

[](#usage)

### Configuration

[](#configuration)

These are the variables you need to set in your .env.

```
# Client ID from the app's keys tab.
QB_CLIENT_ID=

# Client Secret from the app's keys tab.
QB_CLIENT_SECRET=

# The redirect URI provided on the Redirect URIs part under keys tab.
QB_REDIRECT_URI=

# Quickbooks scope com.intuit.quickbooks.accounting or com.intuit.quickbooks.payment
QB_SCOPE=

# Development/Production
QB_BASE_URL=

```

### Token Handling

[](#token-handling)

Since every application is setup differently, you will need to create a class that extends `QuickBooksTokenHandler` to persist the tokens in your database. By default, the tokens are stored using the Laravel Cache API for 7 days.

For example, if you use the [Laravel Options](https://github.com/appstract/laravel-options) package you would create the following class somewhere in your project:

```
namespace App\QuickBooks;

use LifeOnScreen\LaravelQuickBooks\QuickBooksTokenHandler;

class TokenHandler extends QuickBooksTokenHandler
{
    public function set($key, $value)
    {
        option([$key => $value]);
    }

    public function get($key)
    {
        return option($key);
    }
}
```

Then bind it in your `AppServiceProvider.php`:

```
public function boot()
{
    $this->app->bind(
        \LifeOnScreen\LaravelQuickBooks\QuickBooksTokenHandlerInterface::class,
        \App\QuickBooks\TokenHandler::class
    );
}
```

### Connect QuickBooks account

[](#connect-quickbooks-account)

To connect your application with your QuickBooks company you can use `QuickBooksAuthenticator` helper. It has two methods:

- `getAuthorizationUrl()` - Returns redirect URL and puts `quickbooks_auth` cookie into Laravel cookie queue. Cookie is valid for 30 minutes.
- `processHook()` - Validates `quickbooks_auth` cookie and sets realm id, access token and refresh token.

Usage example:

```
namespace App\Http\Controllers;

use LifeOnScreen\LaravelQuickBooks\QuickBooksAuthenticator;
use Cookie;

class QuickBooksController extends Controller
{
    public function connect()
    {
        return redirect(QuickBooksAuthenticator::getAuthorizationUrl())
            ->withCookies(Cookie::getQueuedCookies());
    }

    public function refreshTokens()
    {
        if (QuickBooksAuthenticator::processHook()) {
            return 'Tokens successfully refreshed.';
        }

        return 'There were some problems refreshing tokens.';
    }
}
```

### Sync Eloquent model to QuickBooks

[](#sync-eloquent-model-to-quickbooks)

You can either extend the `LifeOnScreen\LaravelQuickBooks\QuickBooksEntity` class which is already extending the Eloquent model or you can use the `LifeOnScreen\LaravelQuickBooks\SyncsToQuickBooks` trait.

Then you have to define:

- `quickBooksResource` - One of the QuickBooks resources classes (e.g.. `\LifeOnScreen\LaravelQuickBooks\Resources\Company::class`).
- `getQuickBooksArray()` - This method must return the associative array which will be synced to QuickBooks.
- `quickBooksIdColumn` (optional) - The column to use for storing the QuickBooks ID (defaults to `quickbooks_id`)

Usage example:

```
namespace App\Models\Company;

use LifeOnScreen\LaravelQuickBooks\QuickBooksEntity;
use LifeOnScreen\LaravelQuickBooks\Resources\Customer;

class Company extends QuickBooksEntity
{
    /**
     * Database column name
     * This is optional default value is 'quickbooks_id'
     * @var string
     */
    protected $quickBooksIdColumn = 'quickbooks_id';

    /**
     * Use one of LifeOnScreen\LaravelQuickBooks\Resources classes
     * @var array
     */
    protected $quickBooksResource = Customer::class;

    /**
     * @return array
     */
    protected function getQuickBooksArray(): array
    {
        return [
            'CompanyName'  => 'Example name',
            'DisplayName'  => 'Example display name',
            //...
        ];
    }
}
```

When you want to sync a resource you must call `syncToQuickBooks()`. Method returns true if syncing is successful. You can get last QuickBooks error with method `getLastQuickBooksError()`.

Syncing example:

```
/**
 * @return string
 * @throws \Exception
 */
public function syncExample()
{
    $company = Company::find(1);
    if ($company->syncToQuickBooks()){
        return 'Success';
    }
    return $company->getLastQuickBooksError();
}
```

### Using the QuickBooks Resource Classes

[](#using-the-quickbooks-resource-classes)

You can use the included resource classes in `LifeOnScreen\LaravelQuickBooks\Resources` to create, update, and query resources from QuickBooks.

Examples:

```
$customer = new LifeOnScreen\LaravelQuickBooks\Resources\Customer;

// create
$customer->create([
    'GivenName'  => 'John',
    'FamilyName' => 'Smith',
]);

// update item with ID "123"
$customer->update(123, [
    'GivenName'  => 'John',
    'FamilyName' => 'Smith',
]);

// find by ID:
$customer->find(123);

// find by a specific field:
$customer->findBy('FamilyName', 'Smith');

// find multiple items:
$customer->query();

```

See `QuickBooksResource.php` for further documentation.

Changelog
---------

[](#changelog)

Please see the [changelog](changelog.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [contributing.md](contributing.md) for details and a todolist.

Security
--------

[](#security)

If you discover any security related issues, please email author instead of using the issue tracker.

Credits
-------

[](#credits)

- [Jani Cerar](https://github.com/janicerar), [Aaron Harp](https://github.com/arharp)

License
-------

[](#license)

MIT license. Please see the [license file](license.md) for more information.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1182d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/66ecbdac70efd070a054b1c4da74390742f644465bb5c0301df3153a5da1f0ee?d=identicon)[Responsilicious](/maintainers/Responsilicious)

---

Top Contributors

[![arharp](https://avatars.githubusercontent.com/u/531493?v=4)](https://github.com/arharp "arharp (4 commits)")[![janicerar](https://avatars.githubusercontent.com/u/29040621?v=4)](https://github.com/janicerar "janicerar (4 commits)")[![aharp-afg](https://avatars.githubusercontent.com/u/39571284?v=4)](https://github.com/aharp-afg "aharp-afg (1 commits)")[![Responsilicious](https://avatars.githubusercontent.com/u/7826064?v=4)](https://github.com/Responsilicious "Responsilicious (1 commits)")

---

Tags

laravellaravel-quickbooks

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/responsilicious-laravel-quickbooks/health.svg)

```
[![Health](https://phpackages.com/badges/responsilicious-laravel-quickbooks/health.svg)](https://phpackages.com/packages/responsilicious-laravel-quickbooks)
```

###  Alternatives

[spinen/laravel-quickbooks-client

SPINEN's Laravel Client for QuickBooks.

4946.7k](/packages/spinen-laravel-quickbooks-client)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
