PHPackages                             nafiswatsiq/subbase - 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. nafiswatsiq/subbase

ActiveLibrary[Payment Processing](/categories/payments)

nafiswatsiq/subbase
===================

Filament plugin for advanced subscriptions

v1.2.2(2w ago)212MITPHPPHP ^8.2

Since May 16Pushed 1w agoCompare

[ Source](https://github.com/nafiswatsiq/subbase)[ Packagist](https://packagist.org/packages/nafiswatsiq/subbase)[ Docs](https://github.com/nafiswatsiq/subbase)[ RSS](/packages/nafiswatsiq-subbase/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (2)Dependencies (3)Versions (13)Used By (0)

[![header](./.github/resources/banner.jpg)](./.github/resources/banner.jpg)

Subbase - Filament Subscription Management Plugin
=================================================

[](#subbase---filament-subscription-management-plugin)

[![Latest Version on Packagist](https://camo.githubusercontent.com/d2141b66f4cb51f24cc1a5caf4d643401273cfa6538e76abf498e85c257bbfa0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e616669737761747369712f737562626173652e7376673f696e636c7564655f70726572656c6561736573)](https://packagist.org/packages/nafiswatsiq/subbase)[![Software License](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/d3934b385ed719f9329a8b0854bd0829ed1b12365136249a6e56cfd9c3ed9155/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e616669737761747369712f737562626173652e737667)](https://packagist.org/packages/nafiswatsiq/subbase)

[![Screenshot](./.github/resources/plans.png)](./.github/resources/plans.png)

[![Screenshot](./.github/resources/edit-plan.png)](./.github/resources/edit-plan.png)

[![Screenshot](./.github/resources/subscriber.png)](./.github/resources/subscriber.png)

Advanced subscription management system for Laravel with Filament admin panel integration. Built on top of [`laravelcm/laravel-subscriptions`](https://github.com/laravelcm/laravel-subscriptions) with multi-currency support, optional role/permission support, and custom model flexibility.

Features
--------

[](#features)

- 📋 **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
- 🌍 **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-permission` when installed, but still works without it

Requirements
------------

[](#requirements)

- PHP 8.2+
- Laravel 13.7+
- Filament 5.0+
- laravelcm/laravel-subscriptions 1.8+

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

[](#installation)

### 1. Install via Composer

[](#1-install-via-composer)

```
composer require nafiswatsiq/subbase
```

### 2. Publish Config &amp; Migrations

[](#2-publish-config--migrations)

```
php artisan subbase:install
php artisan migrate
```

### 3. Add Subscriptions to User model

[](#3-add-subscriptions-to-user-model)

In your User model just use trait like this:

```
namespace App\Models;

use Laravelcm\Subscriptions\Traits\HasPlanSubscriptions;
use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable
{
    use HasPlanSubscriptions;
}
```

### 4. Register Plugin in Filament Panel

[](#4-register-plugin-in-filament-panel)

In your `app/Providers/Filament/AdminPanelProvider.php`:

```
use Nafiswatsiq\Subbase\SubbasePlugin;

class AdminPanelProvider extends PanelProvider
{
    public function panel(Panel $panel): Panel
    {
        return $panel
            ->plugin(SubbasePlugin::make())
            // ... rest of configuration
    }
}
```

### 5. Register Service Provider (optional, auto-discovered)

[](#5-register-service-provider-optional-auto-discovered)

The service provider is auto-discovered via `composer.json` extra field. If auto-discovery is disabled, add manually in `bootstrap/providers.php`:

```
Nafiswatsiq\Subbase\SubbaseServiceProvider::class,
```

Configuration
-------------

[](#configuration)

### Default Configuration

[](#default-configuration)

Publish config file:

```
php artisan vendor:publish --tag="subbase-config"
```

Edit `config/subbase.php` to customize:

- Default currency
- Locale to currency mapping
- Language locale mapping
- Subscription table names
- Model bindings (for custom models)
- Optional permission strings

### Optional Role Permission Integration

[](#optional-role-permission-integration)

If your app installs `spatie/laravel-permission`, you can control access to the plugin with permission names in `config/subbase.php`:

```
'permissions' => [
    'plan' => 'manage subbase plans',
    'subscription' => 'manage subbase subscriptions',
    'feature' => 'manage subbase features',
],
```

Behavior:

- If `spatie/laravel-permission` is installed, Filament resource access follows those permission strings.
- If it is not installed, the plugin remains fully usable and permissions are ignored.
- If the permission value is left empty, Subbase falls back to Shield-style names such as `ViewAny:Plan` and `ViewAny:Subscription` for the built-in resources.

### Custom Models

[](#custom-models)

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`.

Core Subscription Usage
-----------------------

[](#core-subscription-usage)

Subbase uses `laravelcm/laravel-subscriptions` under the hood to handle all core subscription logic (subscribing, canceling, checking features, swapping plans, etc.).

For complete documentation on how to use the underlying subscription methods on your User model, please refer to the official repository: 👉 [laravelcm/laravel-subscriptions on GitHub](https://github.com/laravelcm/laravel-subscriptions)

New Subbase Features
--------------------

[](#new-subbase-features)

Subbase adds several powerful features on top of the base package:

### 1. Multi-Currency Pricing

[](#1-multi-currency-pricing)

Plans in Subbase can store prices for multiple currencies natively. Use the built-in Filament panel to set prices for `USD`, `EUR`, `IDR`, etc. The pricing component will automatically display the correct currency based on your `subbase.php` locale mappings.

**Usage Examples:**

```
use Nafiswatsiq\Subbase\Models\Plan;

$plan = Plan::first();

// Retrieve price for a specific currency
$priceInUSD = $plan->getPriceForCurrency('USD');

// Retrieve price automatically based on application locale (e.g., 'en-US' mapped to 'USD')
// Returns the base price if the currency is not set
$priceForLocale = $plan->getPriceForLocale(app()->getLocale());

// Check if a plan has a price set for a specific currency
if ($plan->hasCurrencyPrice('EUR')) {
    // ...
}

// Get all currencies configured for the plan
$currencies = $plan->getAvailableCurrencies(); // ['USD', 'IDR', 'EUR']

// Programmatically set a price for a currency
$plan->setPriceForCurrency('EUR', 15.99)->save();
```

### 2. Featured Plans

[](#2-featured-plans)

You can mark specific plans as "Featured" (your most popular plan). To easily retrieve only the featured plans in your application, you can use the `featured` attribute:

```
use Nafiswatsiq\Subbase\Models\Plan;

$plan = Plan::active()->first();
$plan->featured;
```

Frontend Components
-------------------

[](#frontend-components)

[![Screenshot](./.github/resources/plans-component.png)](./.github/resources/plans-component.png)

Subbase includes a modern, reusable Blade component built with Tailwind CSS to display pricing plans on your frontend.

To use the pricing table in any of your Blade views, simply include the component:

```

```

```
// Example Route
Route::get('subscribe/{plan}', function ($plan) {
    dd($plan);
})->name('your.custom.checkout.route');
```

### Component Features

[](#component-features)

- Automatically fetches active plans and features sorted by `sort_order`.
- Displays the most popular (featured) plan prominently.
- Formats prices correctly based on the current application locale and currencies.
- Translatable using Laravel's built-in localization.
- Responsive design tailored for modern web applications.
- Built-in tabs for filtering plans by invoice interval (monthly, yearly, etc).
- **Customizable Action Route**: Pass `subscribe-route` prop to direct users to your custom checkout flow.

### Publishing the Component

[](#publishing-the-component)

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"
```

Multi-Language Support
----------------------

[](#multi-language-support)

Translations are organized in `resources/lang/{locale}/subbase/`:

- `plan.php` - Plan-related labels
- `subscription.php` - Subscription-related labels

Override by publishing translations:

```
php artisan vendor:publish --tag="subbase-translations"
```

Support
-------

[](#support)

- 📖 Documentation: [GitHub Wiki](https://github.com/nafiswatsiq/subbase/wiki)
- 🐛 Issues: [GitHub Issues](https://github.com/nafiswatsiq/subbase/issues)
- 💬 Discussions: [GitHub Discussions](https://github.com/nafiswatsiq/subbase/discussions)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

Credits
-------

[](#credits)

- Built with [Filament](https://filamentphp.com)
- Powered by [laravelcm/laravel-subscriptions](https://github.com/laravelcm/laravel-subscriptions)
- Internationalization by [Spatie Laravel Translatable](https://github.com/spatie/laravel-translatable)

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance97

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

12

Last Release

17d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8cff7391e951a88c4258061e257dd920bad3066e8a819b3236b9d483f71807dc?d=identicon)[nafiswatsiq](/maintainers/nafiswatsiq)

---

Top Contributors

[![nafiswatsiq](https://avatars.githubusercontent.com/u/90527570?v=4)](https://github.com/nafiswatsiq "nafiswatsiq (26 commits)")

---

Tags

laravelbillingsubscriptionsaasfilamentmulti-currency

### Embed Badge

![Health badge](/badges/nafiswatsiq-subbase/health.svg)

```
[![Health](https://phpackages.com/badges/nafiswatsiq-subbase/health.svg)](https://phpackages.com/packages/nafiswatsiq-subbase)
```

###  Alternatives

[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3913.7k](/packages/rawilk-profile-filament-plugin)[stephenjude/filament-jetstream

A Laravel starter kit built with Filament inspired by Jetstream.

17758.9k2](/packages/stephenjude-filament-jetstream)[stephenjude/filament-two-factor-authentication

Filament Two Factor Authentication: Google 2FA + Passkey Authentication

84192.9k7](/packages/stephenjude-filament-two-factor-authentication)[danestves/laravel-polar

A package to easily integrate your Laravel application with Polar.sh

7918.0k](/packages/danestves-laravel-polar)[marcelweidum/filament-passkeys

Use passkeys in your filamentphp app

6643.3k](/packages/marcelweidum-filament-passkeys)[mradder/filament-logger

Audit logging, activity tracking, exports, alerts, and dashboards for Filament admin panels.

2210.5k](/packages/mradder-filament-logger)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
