PHPackages                             whilesmart/entitlements-cashier - 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. whilesmart/entitlements-cashier

ActiveLibrary

whilesmart/entitlements-cashier
===============================

Laravel Cashier billing adapter for whilesmart/eloquent-entitlements: fulfils the BillingProvider seam so any entitlement owner can check out through Stripe and have its subscription state reflected onto its plan.

0.1.1(yesterday)016↑2712.5%MITPHP ^8.2

Since Jul 19Compare

[ Source](https://github.com/whilesmartphp/entitlements-cashier)[ Packagist](https://packagist.org/packages/whilesmart/entitlements-cashier)[ RSS](/packages/whilesmart-entitlements-cashier/feed)WikiDiscussions Synced today

READMEChangelog (2)Dependencies (6)Versions (7)Used By (0)

Entitlements Cashier
====================

[](#entitlements-cashier)

A Laravel Cashier billing adapter for [`whilesmart/eloquent-entitlements`](https://github.com/whilesmartphp/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
---

[](#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
-------

[](#install)

```
composer require whilesmart/entitlements-cashier
php artisan migrate

```

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
------------

[](#how-it-works)

- **`BillingProfile`** is the Cashier customer, keyed to a polymorphic `owner`. It is separate from the owner model so Cashier's `Billable` trait never collides with the owner's own `invoices()` / `subscriptions()` relations.
- **`createCheckout($owner, $plan)`** opens a Stripe Checkout session for the plan's `provider_price_id` and returns the redirect URL.
- **The webhook listener** reflects `checkout.session.completed`, `customer.subscription.updated`, and `customer.subscription.deleted` onto the owner's entitlement subscription: the paid plan is granted, changed, or (on deletion) replaced with the configured `default_plan` or cancelled.

Prices
------

[](#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:

```
php artisan entitlements-cashier:sync-prices

```

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
-------------

[](#configuration)

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

KeyPurpose`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 an owner falls back to when its Stripe subscription is deleted. Null cancels the entitlement instead.`register_migrations`Set false to bring your own migrations.Testing
-------

[](#testing)

```
composer test

```

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance100

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

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 ~0 days

Total

2

Last Release

1d ago

### Community

Maintainers

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

###  Code Quality

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/whilesmart-entitlements-cashier/health.svg)

```
[![Health](https://phpackages.com/badges/whilesmart-entitlements-cashier/health.svg)](https://phpackages.com/packages/whilesmart-entitlements-cashier)
```

###  Alternatives

[bagisto/bagisto

Bagisto Laravel E-Commerce

27.6k172.1k9](/packages/bagisto-bagisto)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135224.7k8](/packages/statamic-rad-pack-runway)[duncanmcclean/statamic-cargo

Comprehensive e-commerce addon for Statamic. Build bespoke e-commerce sites without the complexity.

3518.3k](/packages/duncanmcclean-statamic-cargo)[api-platform/laravel

API Platform support for Laravel

58174.6k17](/packages/api-platform-laravel)

PHPackages © 2026

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