PHPackages                             cboxdk/laravel-billing - 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. [Payment Processing](/categories/payments)
4. /
5. cboxdk/laravel-billing

ActiveLibrary[Payment Processing](/categories/payments)

cboxdk/laravel-billing
======================

Cbox Billing — the billing engine for Laravel — a gateway-agnostic library: catalog, subscriptions, real-time usage metering with hard limits, a double-entry ledger, invoicing, and pricing operations.

v0.9.0(1mo ago)4446↓75%3MITPHPPHP ^8.4CI passing

Since Jul 15Pushed 4w agoCompare

[ Source](https://github.com/cboxdk/laravel-billing)[ Packagist](https://packagist.org/packages/cboxdk/laravel-billing)[ RSS](/packages/cboxdk-laravel-billing/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (8)Dependencies (24)Versions (11)Used By (3)

Cbox Billing
============

[](#cbox-billing)

**`cboxdk/laravel-billing`** — the billing engine for Laravel: a gateway-agnostic library of billing primitives (catalog, subscriptions, **real-time usage metering with hard limits**, a double-entry ledger, wallets &amp; credits, invoicing, pricing) you compose into a billing product. The framework peer to [`cboxdk/laravel-id`](https://github.com/cboxdk/laravel-id) — UI-free and domain-free: every capability sits behind a contract you bind, mock or replace.

> This is the **package**, not the product. The deployable, self-hostable billing app built on it — with an admin console and customer portal — is the separate **`cboxdk/cbox-billing`** application (exactly as `cbox-id` is the app built on `laravel-id`). Reach for the app if you don't want to build the UI/hosting layer yourself; reach for this package to embed billing in your own Laravel app.

> **Status: v0.8.1 (pre-1.0).** The architecture is settled and the full module surface — metering, wallets, ledger, reconciliation, subscriptions, entitlements, accounts, catalog, quotes/invoicing, payments, refunds — has shipped behind contracts. Start with the [documentation](docs/index.md); the architecture rationale is in [`docs/getting-started/architecture.md`](docs/getting-started/architecture.md)and the hardened decisions in the [ADRs](adr/).

Documentation
-------------

[](#documentation)

Full docs live in [`docs/`](docs/index.md):

- [Quick start](docs/quickstart.md) — install to a hard-limited usage check.
- [Core concepts](docs/core-concepts/_index.md) — one page per module.
- [Cookbook](docs/cookbook/_index.md) — task-first recipes.
- [Extension points](docs/extension-points/_index.md) — contracts, adapters, testing.
- [Configuration](docs/configuration/_index.md) · [Security](docs/security/_index.md).

The three-layer model (why it's correct)
----------------------------------------

[](#the-three-layer-model-why-its-correct)

Real-time enforcement, metering truth, and money are **three separate concerns**— the invoice is **computed from the immutable event log**, never read from a counter:

1. **Enforcement** — an app-local counter (Laravel cache, atomic increment/ decrement, no custom Lua) answering *"may this request proceed?"* in sub-ms. Disposable; rebuildable from the event log.
2. **Metering truth** — an immutable, append-only usage event log. Invoices are recomputed from it with the pinned price, never read from counters.
3. **Money** — a double-entry ledger; balances derived from immutable postings.

Hard limits are enforced **locally per node** against a **leased slice** of the org's allowance (pessimistic leasing → no cross-node overspend, only a small, bounded, backfillable drift) — **no shared/co-located Redis** required.

Metering enforcement — shipped
------------------------------

[](#metering-enforcement--shipped)

```
use Cbox\Billing\Metering\Contracts\Enforcement;

$reservation = $enforcement->reserve($org, 'api.calls', estimate: 5); // hard-blocks when exhausted
// … do the work …
$enforcement->commit($reservation, actual: 5);                        // settles + emits a durable usage event
```

- Lease-backed local hard limit (`LeasedEnforcement`), refilling from an `AllowanceLeaseSource` when depleted.
- `CacheLocalStore` — Laravel-cache-backed, atomic decrement-and-compensate (only ever over-rejects, never over-grants).
- Durable local `UsageBuffer` for crash-safe sync to billing's ingest.
- Dogfooded `Testing\InteractsWithMetering` + `FakeAllowanceLeaseSource`.

Requirements
------------

[](#requirements)

PHP `^8.4`; Laravel `^13`. See [`docs/requirements.md`](docs/requirements.md) and `composer.json`.

Development
-----------

[](#development)

```
composer install
composer qa    # pint --test, phpstan (level max), pest, license-check, audit
```

License
-------

[](#license)

MIT.

###  Health Score

46

—

FairBetter than 92% of packages

Maintenance94

Actively maintained with recent releases

Popularity22

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~1 days

Total

10

Last Release

35d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b9761a79e61f2d5b9d650510dfb3555da18daf38f027aa84012c937e397e39a7?d=identicon)[cboxdk](/maintainers/cboxdk)

---

Top Contributors

[![sylvesterdamgaard](https://avatars.githubusercontent.com/u/2431914?v=4)](https://github.com/sylvesterdamgaard "sylvesterdamgaard (58 commits)")

---

Tags

billingcboxinvoicinglaravelledgermeteringsubscriptionsusage-basedlaravelbillingsubscriptionsinvoicingmeteringledgercboxusage-based

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/cboxdk-laravel-billing/health.svg)

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3365.5M359](/packages/psalm-plugin-laravel)[laravel/ai

The official AI SDK for Laravel.

1.1k6.4M360](/packages/laravel-ai)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k17.6M165](/packages/laravel-pulse)[propaganistas/laravel-disposable-email

Disposable email validator

6093.4M9](/packages/propaganistas-laravel-disposable-email)[laravel/scout

Laravel Scout provides a driver based solution to searching your Eloquent models.

1.7k59.5M712](/packages/laravel-scout)[spatie/laravel-health

Monitor the health of a Laravel application

89313.5M195](/packages/spatie-laravel-health)

PHPackages © 2026

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