# Laravel Cashier[](#laravel-cashier)

> For the complete machine-readable documentation index, see [llms.txt](https://apidocs.chargebee.com/llms.txt).


Laravel Cashier Chargebee provides an expressive, fluent interface to Chargebee's subscription billing services. It handles almost all of the boilerplate subscription billing code you are dreading writing, including subscription management, checkout, invoices, payment methods, and more.

## Prerequisites[](#prerequisites)

-   PHP 8.1 or later
-   Laravel 10, 11, or 12
-   [Chargebee PHP SDK](/docs/sdks/php) v4.8.0 or later (installed automatically)

## Installation[](#installation)

Publish and run the migrations:

Optionally publish the configuration file:

## Configuration[](#configuration)

Add your Chargebee credentials to `.env`:

### Billable Model[](#billable-model)

Add the `Billable` trait to your user model:

## Features[](#features)

-   **Customers** — Create, retrieve, update, and sync Chargebee customers
-   **Subscriptions** — Full lifecycle management (create, update, cancel, resume, pause)
-   **Checkout** — Product, subscription, and single-charge checkouts via Hosted Pages
-   **Payment Methods** — Add, list, update default, and delete payment sources
-   **Invoices** — Retrieve, preview upcoming, and generate PDF invoices
-   **Billing Portal** — Redirect customers to a self-service portal
-   **Webhooks** — Automatic handling with Basic Auth verification
-   **Trials** — With or without payment method, check/end/extend
-   **Entitlements** — Configure and check feature entitlements

## Customers[](#customers)

## Subscriptions[](#subscriptions)

### Creating a Subscription[](#creating-a-subscription)

### Checking Status[](#checking-status)

### Cancelling[](#cancelling)

## Checkout[](#checkout)

### Product Checkout[](#product-checkout)

### Subscription Checkout[](#subscription-checkout)

### Single Charge Checkout[](#single-charge-checkout)

## Billing Portal[](#billing-portal)

Redirect users to the self-service billing portal:

## Webhooks[](#webhooks)

### Setup[](#setup)

Create a webhook via Artisan:

This registers a webhook at `https://your-domain.com/chargebee/webhook`. Configure Basic Auth credentials in your `config/cashier.php`:

### Handling Events[](#handling-events)

Cashier automatically handles subscription state changes from webhooks. To handle additional events, listen to Cashier's events in your `EventServiceProvider`:

## Invoices[](#invoices)

## Entitlements[](#entitlements)

Entitlements require enabling in config and adding the `HasEntitlements` trait to your model:

Generate the feature enum:

Then check access using the generated enum:

## Links[](#links)

-   [GitHub Repository](https://github.com/chargebee/cashier-chargebee)
-   [Full Documentation](https://github.com/chargebee/cashier-chargebee/blob/main/DOCUMENTATION.md)
-   [Laravel Starter Kit](https://github.com/chargebee/laravel-react-starter-kit)
-   [PHP SDK](/docs/sdks/php)
-   [API Reference](/docs/api/getting-started)