Subbase adds a Filament admin panel and flexible pricing tools to
laravelcm/laravel-subscriptions.
It supports multi-currency plans, discounts, translations, and custom models.
- 📋 Plan Management - Create and manage subscription plans with features
- 💰 Multi-Currency Pricing - Support for multiple currencies per plan
- 📅 Subscription Lifecycle - Full subscription state management (trial, active, canceled, expired)
- 🎯 Feature-Based Billing - Assign features to plans with usage tracking
- 💹 Discounts & Promo Codes - Percentage or fixed-amount discounts with validation, usage limits, and plan targeting
- 🎨 Multi-Theme Support - 6 built-in UI themes (
default,neo-brutalism,glassmorphism,neumorphism,cyberpunk,maximalism) with CLI management and dynamic view resolution - �🌍 Multi-Language Support - Translatable plan names, descriptions, and features
- 🎨 Filament Integration - Beautiful admin interface with Filament v5
- ⚙️ Custom Models - Use your own models extending base subscription models
- 🔐 Optional Role Permission - Works with
spatie/laravel-permissionwhen installed, but still works without it
- PHP 8.2+
- Laravel 13.7+
- Filament 5.0+
- laravelcm/laravel-subscriptions 1.8+
composer require nafiswatsiq/subbase
php artisan subbase:install
php artisan migrateAdd the HasPlanSubscriptions trait:
namespace App\Models;
use Laravelcm\Subscriptions\Traits\HasPlanSubscriptions;
use Illuminate\Foundation\Auth\User as Authenticatable;
class User extends Authenticatable
{
use HasPlanSubscriptions;
}Add SubbasePlugin to your panel provider:
use Nafiswatsiq\Subbase\SubbasePlugin;
class AdminPanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel
->plugin(SubbasePlugin::make())
// ... rest of configuration
}
}The service provider is auto-discovered. If auto-discovery is disabled, add it
to bootstrap/providers.php:
Nafiswatsiq\Subbase\SubbaseServiceProvider::class,Use the upgrade command when updating an existing installation:
composer update nafiswatsiq/subbase
php artisan subbase:upgrade --migrations
php artisan migrateUse php artisan subbase:upgrade --config, --views, or --force when you
need to republish those assets.
Publish the configuration when you need to customize defaults:
php artisan vendor:publish --tag="subbase-config"The main options in config/subbase.php are default currency, locale
mapping, table names, model bindings, and permissions.
Spatie permission support is optional. When it is installed, configure resource permissions like this:
'permissions' => [
'plan' => 'manage subbase plans',
'subscription' => 'manage subbase subscriptions',
'feature' => 'manage subbase features',
],Behavior:
- With Spatie installed, resources use the configured permission names.
- Without Spatie, the plugin remains usable and permissions are ignored.
- Empty values use Shield-style names such as
ViewAny:Plan.
Override default models in config/subbase.php:
'models' => [
'plan' => App\Models\CustomPlan::class,
'feature' => App\Models\CustomFeature::class,
'subscription' => App\Models\CustomSubscription::class,
'subscription_usage' => App\Models\CustomSubscriptionUsage::class,
]Ensure your custom models extend the base models from nafiswatsiq/subbase.
Subbase uses laravelcm/laravel-subscriptions for subscribing, canceling,
feature checks, plan swaps, and other subscription operations. See the
upstream documentation
for the complete User model API.
Plans can store prices for multiple ISO 4217 currencies. Use the Filament form or the Plan API:
use Nafiswatsiq\Subbase\Models\Plan;
$plan = Plan::first();
$priceInUSD = $plan->getPriceForCurrency('USD');
$priceForLocale = $plan->getPriceForLocale(app()->getLocale());
$plan->setPriceForCurrency('EUR', 15.99)->save();Manage discounts from the Filament resource at /admin/discounts. Discounts
can be percentage-based or fixed amounts, with optional dates, usage limits,
currency restrictions, and plan targeting.
use Nafiswatsiq\Subbase\Models\Discount;
$discount = Discount::findByCode('NEWYEAR50');
if ($discount->isValid()) {
$discountedAmount = $discount->calculateDiscount(100.00);
}
$discount->markUsed();Mark a plan as featured to highlight it in the pricing component:
use Nafiswatsiq\Subbase\Models\Plan;
$plan = Plan::active()->first();
if ($plan->featured) {
// Highlight this plan.
}Use the reusable Blade component to display active plans and features:
To use the pricing table in any of your Blade views, simply include the component:
<x-subbase::plan-list />Customize header text through label, title, and subtitle:
<x-subbase::plan-list
label="Membership"
title="Choose your access level"
subtitle="Simple plans with no hidden fees."
/>Omitted values keep default text from subbase::plan.pricing.label,
subbase::plan.pricing.title, and subbase::plan.pricing.subtitle. When
translations are unavailable, defaults match the default theme: Pricing,
Simple, transparent pricing, and Choose the plan that fits your needs. No hidden fees.
When nafiswatsiq/subbase-payment is installed, the component automatically
uses its subbase-payment.checkout route. For a custom checkout flow, register
the route first and pass its name with subscribe-route.
To use your own checkout route, define it first and pass its route name:
Route::get('subscribe/{plan}', function ($plan) {
return view('subscribe', compact('plan'));
})->name('your.custom.checkout.route');<x-subbase::plan-list subscribe-route="your.custom.checkout.route" />For hosted checkout and payment gateway support, install the companion
nafiswatsiq/subbase-payment
package. It integrates directly with Subbase plans and the plan-list component.
Read the Subbase Payment documentation
for gateway installation, checkout configuration, webhooks, and subscription
activation through PaymentReceived.
- Fetches active plans and features sorted by
sort_order. - Supports featured plans, locale-aware prices, and invoice interval tabs.
- Uses the payment checkout route automatically when
subbase-paymentis installed. - Supports custom checkout routes through
subscribe-route.
If you need to customize the look and feel of the pricing table, you can publish the view file to your application. This will copy the Blade file to resources/views/vendor/subbase/components/plan-list.blade.php.
Run the following command:
php artisan vendor:publish --tag="subbase-views"Subbase includes 6 built-in UI themes for pricing tables and checkout views:
default— Clean, modern Tailwind CSS design.neo-brutalism— High-contrast borders, solid box shadows, and retro typography.glassmorphism— Dark mode with soft backdrop blurs and glowing gradients.neumorphism— Soft 3D floating cards with dual drop/inner shadows and sleek light elements.cyberpunk— Neon yellow accents, dark grid backdrop, and monospace terminal styling.maximalism— Vibrant color blocking, bold badges, and expressive layout.
Default |
Neo-brutalism |
Glassmorphism |
Neumorphism |
Cyberpunk |
Maximalism |
Set your active theme in .env:
SUBBASE_THEME=neo-brutalismOr configure 'theme' in config/subbase.php:
'theme' => env('SUBBASE_THEME', 'default'),List available themes and current configuration:
php artisan subbase:theme-listInstall or publish assets for a theme:
php artisan subbase:theme-install neo-brutalism --publishUse --force to overwrite published views when republishing.
Translations are organized in resources/lang/{locale}/subbase/:
plan.php- Plan-related labelssubscription.php- Subscription-related labelsdiscount.php- Discount-related labels
Override by publishing translations:
php artisan vendor:publish --tag="subbase-translations"- 📖 Documentation: GitHub Wiki
- 🐛 Issues: GitHub Issues
- 💬 Discussions: GitHub Discussions
The MIT License (MIT). Please see License File for more information.
- Built with Filament
- Powered by laravelcm/laravel-subscriptions
- Internationalization by Spatie Laravel Translatable











