Download the PHP package cboxdk/laravel-id-billing-bridge without Composer
On this page you can find all versions of the php package cboxdk/laravel-id-billing-bridge. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download cboxdk/laravel-id-billing-bridge
More information about cboxdk/laravel-id-billing-bridge
Files in cboxdk/laravel-id-billing-bridge
Package laravel-id-billing-bridge
Short Description Meters Cbox ID identity usage to a billing service — reads the shared auth.* vocabulary off the transactional outbox and reports it exactly once. Optional: install it only where you actually bill.
License MIT
Informations about the package laravel-id-billing-bridge
Cbox ID → Billing bridge
cboxdk/laravel-id-billing-bridge — forwards Cbox ID
domain events to the Cbox Billing client
so identity usage is metered to billing, off the transactional outbox, exactly-once.
It exists so the two stay cleanly separated: Cbox ID meters locally for analytics (works with no billing at all), a billing service meters and gates where you bill, and this small package is the only thing that depends on both.
Optional by design. Install it only where you bill someone; Cbox ID itself never depends on the billing client, and is free to self-host with no limits.
How it works
- Listens for
EventDeliveredon Cbox ID's transactional outbox. - Maps the event to a metric via Cbox ID's shared
EventMetricMap— the sameauth.*vocabulary Cbox ID's own analytics counters and the billing meters use, so a billing meter and a local counter of the same event agree. - Records one unit against the event's organization with the billing client's
UsageBuffer::record($org, $metric, 1)(the client buffers and flushes to the remote billing service).
Two guarantees:
- Per-org only — billing meters are per-organization, so a system-scoped (org-less) event is skipped.
- Exactly-once — outbox delivery is at-least-once and
UsageBuffer::record()appends, so a redelivery would over-bill. A dedup marker (billing_bridge_reported_events, keyed on the event id) lets only the first delivery through.
Install
The service provider auto-registers. Metering starts immediately; disable without removing the package:
Scope
This bridge only reports usage. Hot-path quota gating stays where it belongs —
inline at the action site via BillingClient::reserve() — not on the event bus.
License
MIT. See LICENSE.
All versions of laravel-id-billing-bridge with dependencies
cboxdk/laravel-billing-client Version ^0.3
cboxdk/laravel-id Version >=0.19 <1.0
illuminate/contracts Version ^12.0 || ^13.0
illuminate/database Version ^12.0 || ^13.0
illuminate/support Version ^12.0 || ^13.0