PHPackages                             jeanfprado/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. [Payment Processing](/categories/payments)
4. /
5. jeanfprado/cashier

ActiveLibrary[Payment Processing](/categories/payments)

jeanfprado/cashier
==================

 Cashier provides a subscription billing services.

1.3.0(1mo ago)030MITPHPPHP ^7.3|^8.0|^8.1

Since Apr 7Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/jeanfprado/cashier)[ Packagist](https://packagist.org/packages/jeanfprado/cashier)[ Docs](https://github.com/jeanfprado/cashier)[ RSS](/packages/jeanfprado-cashier/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (3)Versions (8)Used By (0)

Cashier
=======

[](#cashier)

Cashier provides subscription billing for Laravel applications. It handles the recurring billing flow and now uses a product-based catalog (plans, add-ons, and other billable items) attached to each subscription.

Table of Contents
-----------------

[](#table-of-contents)

- [Cashier](#cashier)
    - [Table of Contents](#table-of-contents)
    - [Installation](#installation)
    - [Publishing Config and Migrations](#publishing-config-and-migrations)
    - [Products](#products)
    - [Subscribable Model](#subscribable-model)
    - [Subscriptions](#subscriptions)
    - [Billing](#billing)
    - [Upgrade Notes (Plan to Product)](#upgrade-notes-plan-to-product)
    - [Contributing](#contributing)
    - [License](#license)

Installation
------------

[](#installation)

Install via Composer:

```
composer require jeanfprado/cashier
```

The package supports auto-discovery. If auto-discovery is disabled, register the service provider manually:

```
Jeanfprado\Cashier\CashierServiceProvider::class,
```

Optional facade alias:

```
'Cashier' => Jeanfprado\Cashier\Support\Facade\Cashier::class,
```

Publishing Config and Migrations
--------------------------------

[](#publishing-config-and-migrations)

Publish only the config:

```
php artisan vendor:publish --tag=cashier-config
```

Publish only the migrations:

```
php artisan vendor:publish --tag=cashier-migrations
```

Then run migrations:

```
php artisan migrate
```

Products
--------

[](#products)

Define your products in `config/cashier.php` under `cashier.products`.

Each product supports:

- `name`
- `description` (optional)
- `type` (`Plan`, `Add-on`, `Other`)
- `amount` (decimal)
- `value` (metric value, optional business meaning)
- `operation` (`increment` or `decrement`)
- `settings` (optional JSON)
- `options` (optional JSON)

Seed products from config:

```
php artisan cashier:seed-products
```

Subscribable Model
------------------

[](#subscribable-model)

Set the subscribable model in `config/cashier.php`:

```
'model' => App\Models\User::class,
```

Your model must implement the contract and use the trait:

```
