cboxdk / laravel-nexus
Cbox Nexus — the US economic-nexus engine for Laravel: accumulate a seller's sales per state, detect when a post-Wayfair threshold is crossed, and report where registration is required.
Requires
- php: ^8.4
- cboxdk/laravel-geo: ^0.4 || ^0.5
- illuminate/contracts: ^12.0 || ^13.0
- illuminate/http: ^12.0 || ^13.0
- illuminate/support: ^12.0 || ^13.0
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.18
- orchestra/testbench: ^10.0 || ^11.0
- pestphp/pest: ^3.5 || ^4.0
README
The US economic-nexus engine for Laravel — accumulate a seller's sales per state, detect when a post-Wayfair threshold is crossed, and report where registration is required.
Cbox Nexus is UI-free engine primitives, not a finished application. It owns the
decision logic (below / approaching / triggered / registered per state); the
data — thresholds, the seller's cumulative activity, physical presence, and
existing registrations — is sourced behind contracts. Thresholds ship from the
cited us-tax-data dataset (with each state's measurement period and sales basis);
you bind your own billing data for the rest.
It never accumulates sales itself and never infers nexus from a single invoice — economic nexus turns on the seller's cumulative totals in a state over a measuring period, which the host supplies.
Install
composer require cboxdk/laravel-nexus
Quick use
use Cbox\Nexus\Contracts\NexusEngine; use Cbox\Geo\ValueObjects\SubdivisionCode; $report = app(NexusEngine::class)->report([ new SubdivisionCode('US-CA'), new SubdivisionCode('US-TX'), ]); foreach ($report->triggered() as $evaluation) { // $evaluation->state, $evaluation->reason, $evaluation->threshold->describe() }
Bind a SalesLedger (from your invoices), and optionally PhysicalNexus and
NexusRegistrations, so the engine has the seller's side of the equation.
Documentation
See /docs: the quickstart, the
decision model, and the
data seams you bind.
License
MIT.