Download the PHP package whilesmart/entitlements-cashier without Composer

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

Entitlements Cashier

A Laravel Cashier billing adapter for whilesmart/eloquent-entitlements. It fulfils the entitlements BillingProvider seam so any entitlement owner (a workspace, team, or user) can check out through Stripe and have its subscription state reflected onto its plan, without each app rebuilding the wiring.

Why

eloquent-entitlements owns the seam (BillingProvider) and stays payment-SDK-neutral. This package is the Cashier implementation of that seam, shipped once so a host does not hand-roll a billable model, a provider, a webhook listener, and migrations in every project.

Install

Cashier reads STRIPE_KEY, STRIPE_SECRET, and STRIPE_WEBHOOK_SECRET from the environment. Point your Stripe webhook at Cashier's route (/stripe/webhook). Set each paid plan's Stripe Price ID on its provider_price_id.

That is the whole integration. The service provider binds the BillingProvider, makes the billing profile Cashier's customer model, registers the webhook listener, and loads its migrations.

How it works

Prices

A plan's amount is the single source of truth; you do not maintain a Stripe price id. Put the amount on the plan's metadata.price (amount_cents, currency, interval), then run:

For each priced plan this creates a matching Stripe Price and records its id on the plan's provider_price_id. Stripe Prices are immutable, so a new one is created only when the amount, currency, or interval changes; the previous stays for existing subscribers. PlanPriceSync is also resolvable if you prefer to run it from your own seeder.

Configuration

Publish with php artisan vendor:publish --tag=entitlements-cashier-config.

Key Purpose
billing_profile_model Swap the Cashier billable model for a host subclass.
profiles_table The billing profiles table name.
success_url / cancel_url Where Stripe Checkout returns; defaults to the app URL.
default_plan Plan used when no subscription grants access. A host-provided plan source retains precedence.
register_migrations Set false to bring your own migrations.
promotion_codes Show the promotion code box on checkout. On by default.

Discount codes

PromotionCodes makes the codes a buyer types at checkout, as Stripe promotion codes:

stop keeps anybody new from using a code, and subscriptions that already carry it keep it. end also takes it off those subscriptions from their next bill, which is the only way a code that lasts forever ends. A code held for one owner needs that owner to have a Stripe customer, which their first checkout makes.

Testing

Checkout and webhook access

A signing secret is required. Unsigned webhooks are rejected even when the host has not configured billing. Subscribe to checkout completion, subscription creation, updates and deletion, invoice payment failure and successful invoice payment events. Stripe retries a failed delivery; the listener retrieves current state on each retry.

An owner reuses an unexpired checkout session. Existing subscriptions are managed through the customer portal. Trial eligibility is claimed only when Stripe confirms an actual trial, and the trial lasts the configured number of days from activation.

Checkout recovery

Apply the package migrations before enabling checkout. Checkout requests are saved before submission. A retry after a lost response reuses the original request and Stripe idempotency key, including its trial length and return URLs. Changing plans first recovers and expires the unfinished checkout. expireCheckout($owner) also recovers an interrupted checkout before canceling it.

Use a shared cache store with atomic locks when checkout runs on multiple application servers. Hosts can customize checkoutParameters before a new request is saved; retries keep the saved parameters.


All versions of entitlements-cashier with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
laravel/framework Version ^11.0|^12.0
laravel/cashier Version ^16.0
whilesmart/eloquent-entitlements Version ^2.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 whilesmart/entitlements-cashier contains the following files

Loading the files please wait ...