Download the PHP package impruthvi/cashier-entitlements without Composer

On this page you can find all versions of the php package impruthvi/cashier-entitlements. 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 cashier-entitlements

cashier-entitlements

Answer what a customer can access from your own database, not from Stripe.

Latest Version on Packagist Tests Total Downloads

Local entitlement resolution and background billing reconciliation for Laravel Cashier.

Answer "what can this organization do right now?" from your own database — no Stripe call in the request path — and repair that answer in background work when a webhook never arrives.

The problem

Most applications wire access straight to subscription state: read the Stripe row, allow or deny. Two things go wrong.

Your features end up living in Stripe. Feature keys land in price metadata or a JSON column on a provider-synced plan row, and renaming a capability becomes a dashboard edit. Stripe knows about prices. It should not know your application has a feature called ai.generate.

Your local copy silently drifts. A webhook is missed during a deploy and never retried. A subscription's renewal was never set up, so nothing ever failed — it just stopped billing. No event misfired, so no replay or event-driven test will find it. The only thing that catches this class of bug is periodically comparing what your application calls active against what the provider calls active.

This package draws the boundary: Stripe's answer is an input, your application owns the features, resolution is local, and a bounded sweep repairs owners no event ever mentioned.

Installation

Requires PHP 8.3+ and Laravel 12 or 13. Laravel Cashier ^16.8 is optional at install but required for billing diagnostics and reconciliation — native storage and resolution run without it.

Review the migration before running it. Tables are never created automatically at boot. Cashier's tables and these tables must use the same concrete database connection.

Quickstart

1. Own your catalog

Map provider price IDs to your feature keys, in your application, in a service provider:

Changing the catalog requires a new version, a worker restart and fresh owner requests.

2. Choose an outage policy

There is no silent default. Configure one in config/cashier-entitlements.php:

max_stale_age denies paid allowances once the last successful provider read passes that age in seconds. retain_last_known keeps paid access during a provider outage indefinitely — use it only if that tradeoff is acceptable. Both still enforce known trial and cancellation expiry, denied states and catalog-version mismatch.

3. Resolve access

One local query. No Stripe call, no Cashier query, no request-scoped cache. Unknown feature names throw UnknownFeature; calling can() on a numeric feature (or limit() on a boolean) throws FeatureTypeMismatch.

These are allowances, not permissions. Evaluate membership and RBAC separately.

4. Enforce a limit atomically

remaining() is informational. For a hard limit, admit() decides and measures inside the same transaction as your domain write:

Either both commit or neither does. Exceeding the resolved limit throws LimitExceeded before the callback runs. Admission serializes per owner, so concurrent requests queue rather than each reading a stale total.

Two rules the callback must respect: use only the supplied connection (external effects are not covered by the rollback), and stay free of non-transactional side effects — the transaction retries up to three times on deadlock.

Declare a reset rule for every metered feature. There is no default:

5. Keep it current

Request a refresh whenever billing changes, and let the worker apply it:

Requests are durable: they commit before dispatch, survive a failed queue push, and a killed worker's claim becomes reclaimable after its lease expires. When enabled, the package also listens to Cashier's WebhookHandled, re-verifies the signature against the actual request, and checks provider account and live mode before requesting work.

Then schedule the two operational commands:

Plus the sweep, configured in cashier-entitlements.schedule. Recovery and the sweep do different jobs. Recovery re-enqueues requests that already exist. The sweep enumerates an owner scope and requests a refresh for every owner whose observation has gone stale — that is the part that catches an event you never received. Run it comfortably more often than max_stale_age.

6. Check health

doctor reports configuration, backlog, observation staleness, failure reasons and schedule health, locally. reconcile --dry-run compares live Stripe against Cashier without changing any customer's access.

Audited overrides

Time-bound, reasoned, append-only exceptions that outrank the plan:

An expiry is required — there is no permanent override. Off by default; enabling adds one query per resolve.

What this does not do

Optional adapters

Both are off by default and neither is registered automatically.

Each is deliberately narrower than its upstream package. Read docs/m5-adapters.md before enabling either.

Documentation

Doc Covers
m0-compatibility.md Dependency matrix and upstream behavior boundaries
m1-billing.md Typed billing facts, status rules, price mapping
m2-diagnostics.md Catalog binding, read-only Stripe/Cashier comparison
m3-refresh.md Durable refresh, webhooks, local resolution, failure guarantees
m4-usage.md Meters, periods, atomic admission, override ledger
m5-adapters.md Masterix and Pennant supported scope
m6-operations.md Account sweep, doctor, scheduled convergence
sandbox-validation.md Live Stripe sandbox verification record

Verification

The release gate runs the full dependency matrix rather than one convenient lane: Laravel 12 and 13, PHP 8.3/8.4/8.5, lowest and highest dependency resolution, and independent no-optional / Cashier / Masterix / Pennant graphs. It also runs a separate PostgreSQL multi-process test in which competing workers contend for the same owner and a paused worker is proven unable to overwrite its replacement, plus a fresh-consumer install that publishes and migrates without Testbench or any optional package.

An opt-in live Stripe contract suite runs against a sandbox; its credentials are excluded from the default suite and never enter pull-request CI.

Known limits at 0.1.0

Stated plainly so you can judge fit:

Development

test-matrix.sh takes Laravel 12|13, optional dependencies all|none|cashier|masterix|pennant, and lowest|highest. Each run resolves into a separate gitignored build/ directory, preserving your development dependencies. PHP_BINARY and COMPOSER_BINARY select executables.

The ten-thousand-subscription scaling test needs more than PHP's 128M default; composer test and the matrix script both run with 256M.

Configuration publishes under cashier-entitlements, not Masterix's entitlements.

License

MIT. See LICENSE.md.


All versions of cashier-entitlements with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
illuminate/contracts Version ^12.0 || ^13.0
illuminate/database Version ^12.0 || ^13.0
illuminate/support Version ^12.0 || ^13.0
spatie/laravel-package-tools Version ^1.16
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 impruthvi/cashier-entitlements contains the following files

Loading the files please wait ...