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

Surajshetty's avatar

What are the step for using laravel filament as saas application

I understand TALL Stack well, but it is confusing how to implement SAAS with filament. Kindly give me the following steps.

0 likes
11 replies
LaryAI's avatar
Level 58

To use Laravel Filament in a SaaS (Software as a Service) application, you'll need to follow several steps to ensure that your application is structured correctly to handle multiple tenants (customers or users of the SaaS). Here's a step-by-step guide:

  1. Set Up a New Laravel Project: Start by creating a new Laravel project if you haven't already.

    composer create-project laravel/laravel your-saas-app
    cd your-saas-app
    
  2. Install Filament: Install Filament, which is an admin panel for Laravel that uses the TALL stack (Tailwind CSS, Alpine.js, Laravel, and Livewire).

    composer require filament/filament
    
  3. Run Filament Install Command: After installing Filament, publish its assets and create an admin user.

    php artisan filament:install
    
  4. Set Up Multi-Tenancy: For a SaaS application, you'll need to handle data separation between tenants. You can use a package like spatie/laravel-multitenancy to simplify this process.

    composer require spatie/laravel-multitenancy
    

    Follow the package's documentation to set up the database migrations, models, and middleware for handling tenants.

  5. Configure Tenant Identification: Decide how you'll identify different tenants. This could be by domain, subdomain, or a path prefix. Configure the tenant identification logic in the middleware provided by the multi-tenancy package.

  6. Tenant-Specific Migrations: Ensure that your migrations are tenant-specific if necessary. The multi-tenancy package allows you to separate migrations for the landlord (central) and tenant databases.

  7. Create Tenant-Specific Filament Resources: When creating Filament resources (e.g., for CRUD operations), make sure they are tenant-aware. This means that they should only operate on the data belonging to the currently identified tenant.

  8. Tenant-Specific Storage: If your application allows file uploads, configure the filesystem to use tenant-specific directories or disks.

  9. Tenant User Management: Implement functionality to manage tenant users within the Filament admin panel. This includes creating, updating, and deleting users for each tenant.

  10. Subscription Management: Integrate a payment gateway and subscription management system, such as Laravel Cashier, to handle SaaS billing and subscription plans.

    composer require laravel/cashier
    

    Follow the Cashier documentation to set up the necessary tables and logic for handling subscriptions.

  11. Testing: Thoroughly test your application to ensure that tenant data is properly isolated and that all tenant-specific operations are functioning correctly.

  12. Deployment: Deploy your application to a server that supports your chosen method of tenant identification (e.g., wildcard subdomains if using subdomains for tenants).

Remember that this is a high-level overview, and each step involves more detailed implementation work. You'll need to refer to the documentation for each package and Laravel itself for specific configuration details and best practices. Additionally, consider the security implications of handling multiple tenants and ensure that your application is secure and compliant with any relevant regulations.

1 like
Surajshetty's avatar

What should I use for authentication? filament login auths or Laravel jetstream auth?

if I use Laravel jetstream auth for my authentication & authorization kindly give me the steps for the implementation.

jaseofspades88's avatar

@Surajshetty Filament comes with its own authentication, which is easily customisable and once more, well documented.

2 likes
jaseofspades88's avatar

Follow the documentation. It's really well documented. All somebody answering this question will be doing, is paraphrasing the documentation. Have you read any of the documentation?

1 like
Surajshetty's avatar

Yes, I have read the documentation, but I am a little bit confused about the filament auth, many articles are saying to use Laravel jetstream auth and use filament as an admin panel, so how do integrate or should I go forward with filament auth, Kindly guide me through this.

jaseofspades88's avatar
Level 51

Filament comes with its own authentication, registration and forgot password functionality, @Surajshetty. Ignore Jetstream, read the documentation again, properly this time and then try installing it...

1 like
Surajshetty's avatar

Many dev are using Laravel Jetstream auth for the login process and filament as a panel, need some help here?

martinbean's avatar

@Surajshetty Then refine your question.

If you’re not getting responses, then it means your question is too vague or too broad. “How to build a SaaS” is far too broad for any one to answer succinctly.

1 like
menzer's avatar

I think the reason why a lot of people recommended Jetstream for Saas in the past is that filament wasn't widely used and previous to V3 multi-tenancy was not available and it was a bit hacky to use both Jetstream ie: for auth and teams and filament as an Admin panel, however, filament is gathering some serious momentum now with multi-tenancy and many new features in V3x and with the right logic you can achieve much more in a shorter time.

Multi tenancy is a huge area because people have different requirements, so as suggested get familiar with the documentation and maybe start with a small saas project to work out your logics

1 like

Please or to participate in this conversation.