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

lara28580's avatar

Want to set up a billing for my users

I am trying to set up billing for my users. I looked into the filament docs https://filamentphp.com/docs/3.x/panels/tenancy#simple-one-to-many-tenancy I installed spark and everything but I only want to charge every single user for payment and dont want to set up multi tenancy ist there a way? Do i understand something wrong? I dont want to set up teams or something like that. Only charge every single user who registrates for the app.

Please help cant find a tutorial

0 likes
1 reply
LaryAI's avatar
Level 58

It seems like you're conflating two separate concerns: multi-tenancy and billing. Filament's tenancy documentation is about setting up a system where different users (or tenants) have separate data, which might not be what you're looking for if you're just trying to implement billing.

For billing individual users, you don't need to set up multi-tenancy unless you want each user to have a completely isolated set of data. Instead, you can use Laravel Spark, which is designed to handle subscription billing.

Here's a high-level overview of how you can set up billing for individual users with Laravel Spark:

  1. Install Laravel Spark: Follow the official documentation to install Laravel Spark in your application.

  2. Configure Plans: In your Spark configuration file, define the plans you want to offer to your users. You can set up different pricing tiers, features, and intervals (monthly, yearly, etc.).

  3. Spark Service Provider: Make sure to register the Spark service provider in your config/app.php file.

  4. Migrations: Run the migrations that come with Spark to set up the necessary database tables for billing.

  5. User Registration: Customize the registration process to include the option for users to pick a plan and enter their payment information.

  6. Dashboard: Create a user dashboard where users can see their current plan, billing history, and have the option to change or cancel their subscription.

  7. Webhooks: Set up webhooks to handle notifications from the payment gateway (like Stripe) for events such as successful payments, failed payments, and subscription cancellations.

Here's a simplified example of how you might define plans in your Spark configuration:

// In your SparkServiceProvider or a dedicated Spark configuration file

Spark::useStripe()->plans([
    Spark::plan('Basic', 'basic-monthly')
        ->price(10)
        ->features([
            'Feature 1',
            'Feature 2',
        ]),
    Spark::plan('Pro', 'pro-monthly')
        ->price(20)
        ->features([
            'Feature 1',
            'Feature 2',
            'Feature 3',
        ]),
]);

Remember to replace 'basic-monthly' and 'pro-monthly' with the actual IDs of your Stripe plans.

Finally, make sure to read through the Spark documentation thoroughly to understand all the features and how to customize them to fit your application's needs. Spark provides a lot of functionality out of the box, including handling of subscriptions, invoices, and payment methods, which should cover most of your billing requirements.

Please or to participate in this conversation.