Download the PHP package andriichuk/laravel-billing without Composer

On this page you can find all versions of the php package andriichuk/laravel-billing. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-billing

Laravel Billing

A vendor-agnostic subscription billing core for Laravel 13 and PHP 8.5. It provides a Cashier-like application API while keeping Stripe, Paddle, BlueSnap, and every other provider in separate driver packages.

Stability: This package is pre-1.0. Its contracts are intentionally being validated against the first external BlueSnap driver before a stable release. The current development release is available on Packagist.

Architecture

The payment provider is authoritative. Laravel Billing stores a normalized local projection for application queries, authorization, UI, reporting, webhook recovery, and reconciliation. The core knows stable billing concepts only and has no provider SDK dependency.

Drivers expose small capability contracts instead of one mandatory mega-interface. Every stored customer, subscription, transaction, and webhook includes its driver name, so one billable model can use several providers simultaneously. Provider responses retain sanitized raw data, command DTOs accept providerOptions, and Billing::driver() provides an intentional escape hatch to a driver.

See docs/architecture.md for the full design.

Requirements and installation

Install the current development release from Packagist:

Laravel package discovery registers the service provider. Publish configuration and migrations, then migrate:

The published configuration selects a default driver, driver-specific configuration, replaceable model classes, webhook queue routing, retention, and reconciliation chunk size.

Billable models

Add the trait to an Eloquent model:

The local query API is driver-aware:

Installing and selecting drivers

Provider packages register themselves with Laravel's extension mechanism:

Set BILLING_DRIVER=acme for the default, or choose explicitly:

Customers

Creating or synchronizing a customer calls the selected provider and updates the local projection:

Subscriptions

The builder validates common input, creates typed command data, and delegates remote work to ManagesSubscriptions:

Money uses validated decimal strings and uppercase ISO 4217 codes. Floats are intentionally not accepted. Cancellation drivers receive an explicit CancellationMode::AtPeriodEnd or CancellationMode::Immediately; pause, proration, quantity changes, and plan changes are separate optional capabilities.

Normalized subscription states are active, trialing, past_due, paused, canceled, finished, incomplete, and unknown. Local models expose active(), onTrial(), onGracePeriod(), recurring(), and valid() helpers without claiming that every provider has identical lifecycle behavior.

Capability checks

Core orchestration throws UnsupportedCapability with the driver and capability names when an unavailable operation is attempted.

Webhooks and queues

The package registers:

The driver verifies the exact raw body before anything is persisted. Valid events are sanitized, stored idempotently in billing_webhook_events, and handed to a unique queue job. The job applies normalized events under database transactions and records attempts, status, errors, and timestamps. Unknown valid events remain available with ignored status and dispatch WebhookIgnored.

Configure a durable queue in production and run a worker:

See docs/webhooks.md before exposing a provider endpoint.

Reconciliation

Reconciliation refreshes the local projection from authoritative provider data:

Drivers implement ReconcilesResources and stream normalized provider resources. A model without an ID requests a sweep; a model and ID request one resource. since is provider-dependent, while cursor and pageSize let scheduled jobs resume bounded pages.

The core resolves a resource's billable from the matching local provider-ID row. For a provider resource that has never been seen locally, bind ResolvesReconciliationBillables in the application and map provider data to a persisted model:

The resolver receives the driver name, model kind, and resource DTO. Return null when it cannot resolve the owner; reconciliation reports and skips that orphan without failing the sweep.

Subscription and transaction lifecycle events are emitted through the same synchronizer used by webhook projections. They include the persisted billing model and provider resource identity, so listeners can re-read authoritative state under their own lock. Events are dispatched only when projection attributes changed; --force explicitly replays them. --dry-run performs the same comparison but writes and dispatches nothing.

Events

Laravel lifecycle events are independent of provider event names:

Drivers may normalize customer, subscription, transaction, renewal, payment-failure, refund, and chargeback events. Applications can listen to lifecycle events without depending on provider payload formats.

Provider escape hatches

Security

Drivers must remove authorization headers, signature secrets, PANs, CVVs, and sensitive payment data before returning provider data or parsed webhook payloads. Never log raw credentials or payment instruments. Verify webhook signatures against the untouched request bytes, use HTTPS, isolate provider secrets in environment-backed configuration, and use a durable non-sync queue in production.

Development

The bundled fake driver records requests in memory, simulates failures, supports signed webhooks and reconciliation, and enables full lifecycle tests without network calls. External drivers can extend DriverComplianceTestCase; see docs/driver-authoring.md.

License

MIT. See LICENSE.md.


All versions of laravel-billing with dependencies

PHP Build Version
Package Version
Requires php Version ^8.5
ext-json Version *
illuminate/bus Version ^13.0
illuminate/config Version ^13.0
illuminate/console Version ^13.0
illuminate/contracts Version ^13.0
illuminate/database Version ^13.0
illuminate/http Version ^13.0
illuminate/queue Version ^13.0
illuminate/routing Version ^13.0
illuminate/support Version ^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package andriichuk/laravel-billing contains the following files

Loading the files please wait ...