PHPackages                             smbear/avatax - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. smbear/avatax

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

smbear/avatax
=============

avalara avatax

v1.0.28(4y ago)03.6k↓20%1MITPHPPHP ^7.3

Since May 26Pushed 1y ago1 watchersCompare

[ Source](https://github.com/fs-platform/avatax)[ Packagist](https://packagist.org/packages/smbear/avatax)[ Docs](https://github.com/smbear/avatax)[ RSS](/packages/smbear-avatax/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (5)Versions (30)Used By (0)

说明
==

[](#说明)

- 依赖avatax官方扩展包
- 采用psr-4的标准
- 单元测试覆盖基本功能

安装配置
====

[](#安装配置)

安装composer包

```
composer require smbear/avatax

```

发布配置文件

```
php artisan vendor:publish --provider=Smbear\Avatax\AvataxServiceProvider

```

迁移数据表

```
php artisan migrate

```

配置日志channel(config/logging)

```
'avatax' => [
    'driver' => 'daily',
    'path' => storage_path('logs/avatax/avatax.log'),
    'level' => env('LOG_LEVEL', 'debug'),
    'days' => 14,
],

```

使用方式（门面/契约）
===========

[](#使用方式门面契约)

```
use Smbear\Avatax\Facades\Avatax;

$result = Avatax::setAddress([
        'line1'      => '380 Centerpoint Blvd ',
        'city'       => 'New Castle',
        'country'    => 'US',
        'postalCode' => '19720',
        'region'     => 'DE'
    ])
        ->setOrder([
            'documentCode'     => 'FS000000001',
            'customerCode'     => 123456789,
            'entityUseCode'    => 123456789,
            'currencyCode'     => 'USD',
            'exchangeRate'     => 1,
            'description'      => '描述',
            'purchaseOrderNo'  => 'FS000000001',
            'salespersonCode'  => 123,
    ])
        ->setLines([
            'local' =>[
                [
                    "quantity" => "1",
                    "description" => "Cisco QSFP-40G-SR4 Compatible 40GBASE-SR4 QSFP+ 850nm 150m DOM MTP/MPO MMF Optical Transceiver Module",
                    "amount" => "40.8000000000000",
                    "itemCode" => "36157",
                ],
                [
                    "quantity" => 1,
                    "description" => "upsgroundeastzones_upsgroundeastzones",
                    "amount" => "0.00",
                    "itemCode" => "shipping",
                ],
            ],
            'delay' =>[
                [
                    "quantity" => "1",
                    "description" => "Cisco QSFP-40G-SR4 Compatible 40GBASE-SR4 QSFP+ 850nm 150m DOM MTP/MPO MMF Optical Transceiver Module",
                    "amount" => "40.8000000000000",
                    "itemCode" => "36157",
                ],
                [
                    "quantity" => 1,
                    "description" => "upsgroundeastzones_upsgroundeastzones",
                    "amount" => "0.00",
                    "itemCode" => "shipping",
                ],
            ]
        ])
        ->createTransaction('SalesOrder');

```

> setLines函数中设置 lines的二维数组，每一个数组默认表示一个整体订单，返回结果，会使用key作为标识

### 成功返回的数据，当status == 'success' 表示成功，其余所有情况，均为失败

[](#成功返回的数据当status--success-表示成功其余所有情况均为失败)

```
array:4 [▼
  "status" => "success"
  "code" => 200
  "message" => "success"
  "data" => array:2 [▼
    "local" => {#352 ▼
      +"id": 6000155272900
      +"code": "FS000000001"
      +"companyId": 2730548
      +"date": "2021-05-31"
      +"paymentDate": "1900-01-01"
      +"status": "Committed"
      +"type": "SalesInvoice"
      +"batchCode": ""
      +"currencyCode": "USD"
      +"exchangeRateCurrencyCode": "USD"
      +"customerUsageType": "123456789"
      +"entityUseCode": "123456789"
      +"customerVendorCode": "123456789"
      +"customerCode": "123456789"
      +"exemptNo": ""
      +"reconciled": false
      +"locationCode": ""
      +"reportingLocationCode": ""
      +"purchaseOrderNo": "FS000000001"
      +"referenceCode": ""
      +"salespersonCode": "123"
      +"taxOverrideType": "None"
      +"taxOverrideAmount": 0.0
      +"taxOverrideReason": ""
      +"totalAmount": 40.8
      +"totalExempt": 40.8
      +"totalDiscount": 0.0
      +"totalTax": 0.0
      +"totalTaxable": 0.0
      +"totalTaxCalculated": 0.0
      +"adjustmentReason": "Other"
      +"adjustmentDescription": "Create or adjust transaction"
      +"locked": false
      +"region": "DE"
      +"country": "US"
      +"version": 3
      +"softwareVersion": "21.5.1.0"
      +"originAddressId": 0
      +"destinationAddressId": 0
      +"exchangeRateEffectiveDate": "2021-05-31"
      +"exchangeRate": 1.0
      +"isSellerImporterOfRecord": false
      +"description": ""
      +"businessIdentificationNo": ""
      +"modifiedDate": "2021-06-01T02:44:29.0497913Z"
      +"modifiedUserId": 1414955
      +"taxDate": "2021-05-31T00:00:00"
      +"lines": array:2 [▶]
      +"addresses": array:1 [▶]
      +"locationTypes": array:2 [▶]
      +"summary": array:1 [▶]
    }
    "delay" => {#365 ▼
      +"id": 7091650277
      +"code": "FS000000001"
      +"companyId": 2730548
      +"date": "2021-05-31"
      +"paymentDate": "1900-01-01"
      +"status": "Committed"
      +"type": "SalesInvoice"
      +"batchCode": ""
      +"currencyCode": "USD"
      +"exchangeRateCurrencyCode": "USD"
      +"customerUsageType": "123456789"
      +"entityUseCode": "123456789"
      +"customerVendorCode": "123456789"
      +"customerCode": "123456789"
      +"exemptNo": ""
      +"reconciled": false
      +"locationCode": ""
      +"reportingLocationCode": ""
      +"purchaseOrderNo": "FS000000001"
      +"referenceCode": ""
      +"salespersonCode": "123"
      +"taxOverrideType": "None"
      +"taxOverrideAmount": 0.0
      +"taxOverrideReason": ""
      +"totalAmount": 40.8
      +"totalExempt": 40.8
      +"totalDiscount": 0.0
      +"totalTax": 0.0
      +"totalTaxable": 0.0
      +"totalTaxCalculated": 0.0
      +"adjustmentReason": "Other"
      +"adjustmentDescription": "Create or adjust transaction"
      +"locked": false
      +"region": "DE"
      +"country": "US"
      +"version": 4
      +"softwareVersion": "21.5.1.0"
      +"originAddressId": 0
      +"destinationAddressId": 0
      +"exchangeRateEffectiveDate": "2021-05-31"
      +"exchangeRate": 1.0
      +"isSellerImporterOfRecord": false
      +"description": ""
      +"businessIdentificationNo": ""
      +"modifiedDate": "2021-06-01T02:44:29.2929873Z"
      +"modifiedUserId": 1414955
      +"taxDate": "2021-05-31T00:00:00"
      +"lines": array:2 [▶]
      +"addresses": array:1 [▶]
      +"locationTypes": array:2 [▶]
      +"summary": array:1 [▶]
    }
  ]
]

```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 92.3% of commits — single point of failure

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

Every ~0 days

Total

28

Last Release

1819d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a0ea7c3fbb4baaa2a5a9be661bab70daf73c89eb952e50917141dbdf9522a992?d=identicon)[smile-wenjie](/maintainers/smile-wenjie)

---

Top Contributors

[![SmileAany](https://avatars.githubusercontent.com/u/47846456?v=4)](https://github.com/SmileAany "SmileAany (24 commits)")[![timwu1629](https://avatars.githubusercontent.com/u/154110527?v=4)](https://github.com/timwu1629 "timwu1629 (2 commits)")

---

Tags

laravelavalaraAvaTax

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/smbear-avatax/health.svg)

```
[![Health](https://phpackages.com/badges/smbear-avatax/health.svg)](https://phpackages.com/packages/smbear-avatax)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

17221.0k3](/packages/interaction-design-foundation-laravel-geoip)[nedwors/navigator

A Laravel package to ease defining navigation menus

433.1k](/packages/nedwors-navigator)[xefi/faker-php-laravel

Faker php integration with laravel

1915.1k](/packages/xefi-faker-php-laravel)[dcblogdev/laravel-junie

Install pre-configured guides for Jetbrains Junie

392.5k](/packages/dcblogdev-laravel-junie)

PHPackages © 2026

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