Open sourceLaravel package
Laravel Polar
Laravel Polar is an open-source Laravel package maintained by Climactic that integrates Polar.sh billing. A Billable trait adds checkouts, subscriptions, orders and a customer portal to a model, and webhooks keep your database in sync.
Install
composer require climactic/laravel-polar
php artisan polar:install- Type
- Laravel package
- Requires
- PHP 8.3 or later, Laravel 11, 12 or 13
- License
- MIT
- Maintained by
- Climactic
- Runs in
- Markdown Anything, ColorBuk
What it does
- Checkouts
- Single payments, custom prices and an embedded checkout button for Blade.
- Subscriptions
- Swap, cancel, resume and revoke, with trials, discounts and more than one subscription type.
- Webhooks handled
- Polar webhook events arrive as Laravel events, and you can add your own handlers.
- Blade and route helpers
- @subscribed and @onTrial directives, and a polar.subscribed middleware.
- More than subscriptions
- Orders, refunds, invoices, license keys, seats and usage-based billing events.
- Testable
- LaravelPolar::fake() lets you test billing code without calls to Polar.
Example
Start a subscription checkout.
use Illuminate\Http\Request;
Route::get('/subscribe', function (Request $request) {
return $request->user()->subscribe('product_id_123');
});- This package continues the work of danestves/laravel-polar, and credits danestves as the original author.
- The config uses the Polar sandbox server until you change it.
Questions about Laravel Polar
What is Laravel Polar?
Laravel Polar is an open-source Laravel package maintained by Climactic that integrates Polar.sh billing. A Billable trait adds checkouts, subscriptions, orders and a customer portal to a model, and webhooks keep your database in sync.
How do I install Laravel Polar?
Run "composer require climactic/laravel-polar". It needs PHP 8.3 or later, Laravel 11, 12 or 13.
Is Laravel Polar free to use?
Yes. Laravel Polar is open source under the MIT license, and the source code is on GitHub at github.com/Climactic/laravel-polar.
Is Laravel Polar used in production?
Yes. Laravel Polar runs in production in Markdown Anything and ColorBuk, products that Climactic builds and operates.
Who maintains Laravel Polar?
Climactic, a venture studio that builds and operates its own software products, maintains Laravel Polar.
More open source from Climactic
- laravel-credits A ledger-based Laravel package for managing credit-based systems in your application. Runs in Markdown Anything and ColorBuk
- veer Inertia.js server adapter for Rust. Return typed props from axum handlers and render React, Vue or Svelte pages.
- laravel-spam Block spam signups in Laravel with disposable-email, blocklist and StopForumSpam checks.
- laravel-altcha Drop-in Laravel integration for ALTCHA, a privacy-friendly, self-hosted alternative to CAPTCHA.
- pixelserve Self-hosted image proxy and transformer. Resize, crop, and reformat images on demand, and generate Open Graph images. Runs in Markdown Anything and ColorBuk