Download the PHP package jeanfprado/cashier without Composer
On this page you can find all versions of the php package jeanfprado/cashier. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jeanfprado/cashier
More information about jeanfprado/cashier
Files in jeanfprado/cashier
Package cashier
Short Description Cashier provides a subscription billing services.
License MIT
Homepage https://github.com/jeanfprado/cashier
Informations about the package 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
- Cashier
- Table of Contents
- Installation
- Publishing Config and Migrations
- Products
- Subscribable Model
- Subscriptions
- Billing
- Upgrade Notes (Plan to Product)
- Contributing
- License
Installation
Install via Composer:
The package supports auto-discovery. If auto-discovery is disabled, register the service provider manually:
Optional facade alias:
Publishing Config and Migrations
Publish only the config:
Publish only the migrations:
Then run migrations:
Products
Define your products in config/cashier.php under cashier.products.
Each product supports:
namedescription(optional)type(Plan,Add-on,Other)amount(decimal)value(metric value, optional business meaning)operation(incrementordecrement)settings(optional JSON)options(optional JSON)
Seed products from config:
Subscribable Model
Set the subscribable model in config/cashier.php:
Your model must implement the contract and use the trait:
Subscriptions
Create a subscription by passing one or more Product models:
Add or remove products on an existing subscription:
Cancel the current subscription:
Billing
Generate due billings for all subscriptions:
Or generate from code for a single subscription:
Mark a billing as paid:
Upgrade Notes (Plan to Product)
Recent migrations replaced the old plans relation with a product catalog + pivot (subscription_products).
- Existing plan records are migrated into
products. - Existing subscriptions are linked to migrated products.
subscriptions.plan_idis replaced bysubscriptions.type.- The legacy
planstable is removed.
If you are upgrading an existing installation, publish/update migrations and run:
After migrating, review config/cashier.php and run cashier:seed-products to add any new catalog items.
Contributing
Thank you for considering contributing to Cashier.
License
Cashier is open-sourced software licensed under the MIT license.