Laravel Polar is a Cashier-style package that wires Polar.sh billing directly into your Laravel application. Add theDocumentation Index
Fetch the complete documentation index at: https://danestvesllc-2b77d201.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Billable trait to any Eloquent model and you immediately get hosted checkouts, subscription management, webhooks, license keys, usage billing, and more — all through expressive PHP, without writing custom API glue.
New to Polar.sh? It’s an open-source-friendly billing platform built for developers — handling payments, subscriptions, license keys, and metered usage. Laravel Polar is the idiomatic Laravel wrapper around it.
What Laravel Polar covers
Everything billing-related in one package. Here’s a quick map of what’s available:Checkouts
Create hosted or embedded checkout sessions for one-time payments and subscriptions, with support for custom pricing, discount codes, and prefilled customer data.
Subscriptions
Manage recurring subscriptions — create, cancel, resume, swap plans, apply discounts, handle grace periods, and support multiple subscription types per model.
Webhooks
Receive and verify Polar.sh webhook events. The package dispatches typed Laravel events for every supported Polar event type so your listeners stay clean.
License keys
Issue, validate, activate, and deactivate license keys as a product benefit — ideal for desktop apps, CLIs, and SDKs.
Usage billing
Ingest metered usage events and list customer meters to charge customers based on actual consumption.
Orders & invoices
Retrieve order history, issue full or partial refunds, and generate downloadable PDF invoices on demand.
Key features
Billabletrait — add to any Eloquent model (not justUser) to unlock the full API: checkouts, subscriptions, orders, benefits, license keys, payment methods, and more.- Typed webhook events — 21 Laravel events covering orders, subscriptions, checkouts, customers, products, benefit grants, and benefits. Convenience properties (
$billable,$order,$subscription) are available where applicable. LaravelPolarfacade — static helpers for everything the trait doesn’t cover: discount management, checkout links, custom fields, refunds, metrics, and direct SDK access.- Embedded checkout — render Polar’s checkout in a modal overlay using the
<x-polar-button>Blade component and the@polarEmbedScriptdirective. No redirect required. - Model customization — swap in your own
Customer,Subscription, andOrderEloquent models viaLaravelPolar::useCustomerModel()and friends.
Requirements
| Requirement | Version |
|---|---|
| PHP | 8.3 or higher |
| Laravel | 11 or 12 |
| Polar.sh account | Any plan (free to create) |
intl extension is required only if you use non-English currency locales via POLAR_CURRENCY_LOCALE. Run php -m | grep intl to check.
Ready to get started?
Installation
Install the package via Composer and run the one-command setup.
Configuration
Set your access token, webhook secret, and environment options.