承接 shawnreid/laravel-quickbooks 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

shawnreid/laravel-quickbooks

最新稳定版本:v1.0.0

Composer 安装命令:

composer require shawnreid/laravel-quickbooks

包简介

Quickbooks wrapper for Laravel

README 文档

README

Latest Version on Packagist Total Downloads GitHub Actions PHP Stan codecov

Laravel Quickbooks is a token manager and wrapper for the QuickBooks PHP SDK. See Quickbooks API Reference for more details on how to interact with the API.

Requirements

Version
PHP ^8.1
Laravel ^9.0

Installation

You can install the package via composer:

composer require shawnreid/laravel-quickbooks

Publish assets

php artisan vendor:publish --provider="Shawnreid\LaravelQuickbooks\Providers\QuickbooksProvider"

Create database table quickbooks_tokens

php artisan migrate

Configuration

  1. Before starting you will need a QuickBooks developer account to setup a sandbox environment. You will also need a tool such as ngrok to expose your local dev environment.

  2. Quickbooks requires a Redirect URI be provided for OAuth2 authentication. You must set this to: https://<your_url>/quickbooks/token

  3. Add the appropriate values to your .env

    QUICKBOOKS_CLIENT_ID=<Client ID>
    QUICKBOOKS_CLIENT_SECRET=<Client Secret>
    QUICKBOOKS_API_URL=<Development|Production>
    QUICKBOOKS_DEBUG=<true|false>
  4. By default this package will attach to the User Model. If you wish to use another model this can be configured in configs/laravel-quickbooks.php. A trait will need to be included in the model you wish to use.

    Example:

    use Shawnreid\LaravelQuickbooks\Quickbooks;
    
    class User extends Authenticatable
    {
       use Quickbooks;
  5. The token manager middleware by default is set to auth. Depending on your needs you will likely want to change this. This can be configured in configs/laravel-quickbooks.php

Connecting to Quickbooks

This package provides a simple interface for managing quickbooks OAuth2 connections.

  1. Navigate to https://<your_url>/quickbooks
  2. Select model you want to attach connection to and click Create Connection. If configured properly you will be redirected to a QuickBooks authentication page.

You may also revoke tokens or refresh tokens from this interface. Note that anytime an API call is made to QuickBooks this package will automatically refresh the token.

Usage

This package provides syntatic sugar to wrap QuickBooks PHP SDK. Please see QuickBooks Sample CRUD App for additional examples.

Examples

$user = User::find(1);

$user

    // resolve data service
    ->quickbooks()

    // resolve invoice entity
    ->invoice()

    // create invoice
    ->create(
         body: [...]
     )

$user

    // resolve data service
    ->quickbooks()

    // resolve customer entity
    ->customer()

    // update customer
    ->update(
         id: 'id'
         body: [...]
     )

$user

    // resolve data service
    ->quickbooks()

    // resolve bill entity
    ->bill()

    // delete bill
    ->delete(
         id: 'id'
    )

$user

    // resolve data service
    ->quickbooks()

    // resolve vendor entity
     ->vendor()

     // find vendor
     ->find(
         id: 'id'
     )

$user

    // resolve data service
    ->quickbooks()

    // Custom SQL query
    // https://developer.intuit.com/app/developer/qbo/docs/learn/explore-the-quickbooks-online-api/data-queries
    ->query('SELECT * FROM Invoice')

Supported Entities

$user->quickbooks()->account();
$user->quickbooks()->bill();
$user->quickbooks()->billPayment();
$user->quickbooks()->customer();
$user->quickbooks()->estimate();
$user->quickbooks()->invoice();
$user->quickbooks()->item();
$user->quickbooks()->journalEntry();
$user->quickbooks()->payment();
$user->quickbooks()->timeActivity();
$user->quickbooks()->vendor();
$user->quickbooks()->vendorCredit();
$user->quickbooks()->companyCurrency();
$user->quickbooks()->creditMemo();
$user->quickbooks()->department();
$user->quickbooks()->deposit();
$user->quickbooks()->employee();
$user->quickbooks()->purchase();
$user->quickbooks()->purchaseOrder();
$user->quickbooks()->refundReceipt();
$user->quickbooks()->salesReceipt();
$user->quickbooks()->taxAgency();
$user->quickbooks()->taxRate();
$user->quickbooks()->taxService();
$user->quickbooks()->transfer();

Supported CRUD Operations

$user->quickbooks()->invoice()->create([...]);
$user->quickbooks()->invoice()->update('id', [...]);
$user->quickbooks()->invoice()->delete('id');
$user->quickbooks()->invoice()->find('id');

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 19
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 6
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 6
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-01-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固