Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

anjanesh's avatar

Filament as a SaaS ?

So I was thinking of using Nova, which is a paid subscription as a backend for laravel - I knew about Filament but last time I checked, it was a simple backend. But now when I checked the filamentphp website it seems to be an ecosystem of its own ? What's this with "Multi-tenancy built for SaaS." ? We can have a full-blown SaaS suite using filamentphp with payment battery like spark ?

1 like
2 replies
LaryAI's avatar
Level 58

Filament has indeed grown into a more comprehensive admin panel ecosystem for Laravel. The mention of "Multi-tenancy built for SaaS" likely refers to the fact that Filament can be used to build multi-tenant applications, which are essential for SaaS (Software as a Service) platforms.

Multi-tenancy is an architecture where a single instance of the software runs on a server, serving multiple tenants (clients or customers). Each tenant's data is isolated and remains invisible to other tenants. This is a common requirement for SaaS applications, where you might have different companies or users with their own separate data.

While Filament provides a solid foundation for building admin panels and includes a variety of tools and components to speed up development, it does not include a full SaaS suite out of the box. For features like subscription billing, you would still need to integrate with a service like Laravel Spark or implement your own solution using Laravel Cashier.

Here's a basic outline of how you might set up a SaaS application using Filament:

  1. Set up a multi-tenant architecture: You can use packages like spatie/laravel-multitenancy to handle the multi-tenancy aspect of your application. This will allow you to manage multiple tenants with separate databases or prefixed tables within a single database.

  2. Install Filament: Follow the installation instructions on the Filament documentation to get the admin panel up and running.

  3. Customize Filament for your needs: Create custom resources, forms, and tables to manage the data for your application.

  4. Integrate subscription management: Use Laravel Cashier or Spark to handle subscription billing. You'll need to set up plans, handle subscription logic, and integrate with a payment gateway like Stripe or Paddle.

  5. Secure your application: Ensure that users can only access their own data by scoping queries to the current tenant and implementing proper authentication and authorization.

Here's a very simplified example of how you might define a Filament resource in a multi-tenant SaaS application:

use Filament\Resources\Form;
use Filament\Resources\Table;
use Filament\Resources\Resource;
use App\Models\TenantSpecificModel;

class TenantSpecificResource extends Resource
{
    public static function form(Form $form)
    {
        return $form
            ->schema([
                // Define your form fields here
            ]);
    }

    public static function table(Table $table)
    {
        return $table
            ->columns([
                // Define your table columns here
            ])
            ->filters([
                // Define your table filters here
            ]);
    }

    public static function getModel()
    {
        return TenantSpecificModel::class;
    }

    public static function getQuery()
    {
        // Scope the query to the current tenant
        return parent::getQuery()->where('tenant_id', auth()->user()->tenant_id);
    }
}

In this example, TenantSpecificModel would be a model that is scoped to the current tenant, ensuring that users only see their own data.

Remember, building a SaaS application is a complex task that involves many components. Filament can be a part of the solution, especially for the admin panel, but you'll need to carefully plan and implement the other aspects of your SaaS, including multi-tenancy, subscription billing, and user management.

tisuchi's avatar

@anjanesh My opinion would be, YES. I would like to use filamentphp because of its simplicity and faster instead of starting from the sketch.

1 like
ayoolatj's avatar

Filament has come a long way. It's not just a simple backend now, it's got this whole multi-tenancy thing going on. You can actually build a full SaaS suite with it, and it plays nice with Spark for payments.

1 like

Please or to participate in this conversation.