Mastering Laravel Spark: Building a Subscription SaaS in Minutes

Laravel////3 min read

Overview of Next-Generation Spark

Laravel Spark serves as a dedicated SaaS toolkit designed to handle the heavy lifting of recurring billing. Unlike earlier versions, the next generation of Spark is front-end agnostic, meaning it provides a totally isolated billing portal that exists separately from your main application logic. This architectural shift grants you total freedom to use any stack—whether Vue.js, React, or simple Blade templates—without the billing logic cluttering your UI.

Prerequisites and Toolkit

To follow this implementation, you should be comfortable with the Laravel framework and basic terminal operations.

Key Libraries & Tools

  • Laravel Breeze: A minimal, simple starter kit for scaffolding authentication.
  • Paddle: A merchant of record that handles VAT taxes and provides PayPal integration.
  • Stripe: The alternative payment provider supported by Spark.
  • Tailwind CSS: The utility-first CSS framework used for branding the portal.

Implementation Walkthrough

Start by scaffolding authentication using Laravel Breeze. Once your users can log in, install the Paddle edition of Spark via Composer:

composer require laravel/spark-paddle
php artisan spark:install

Next, integrate the Billable trait into your User model. This connects your database entities to the Spark billing engine.

use Spark\Billable;

class User extends Authenticatable
{
    use Billable;
}

Configuring Subscription Plans

Plans reside in config/spark.php. Here, you define your monthly and yearly IDs—which you fetch from your Paddle dashboard—along with feature lists. Spark uses these to automatically generate the pricing toggle in the billing portal.

Branding and UI Integration

Customizing the portal to match your brand (like the green aesthetic of Laravel Forge) happens in the branding section of the config. You can swap the logo and primary button colors using Tailwind CSS classes. To link users to the portal, simply point a navigation link to the /billing route defined in your configuration.

Practical Tips & Gotchas

Always use the onTrial method to show trial banners in your UI. One common mistake is forgetting to set up webhooks; Laravel Spark relies on webhooks to process subscription status changes. If your local environment isn't receiving these, your application won't know when a user has successfully paid.

Topic DensityMention share of the most discussed topics · 19 mentions across 14 distinct topics
Paddle
16%· companies
Laravel Breeze
11%· software
Laravel Spark
11%· software
Tailwind CSS
11%· software
Adam Wathan
5%· people
Other topics
47%
End of Article
Source video
Mastering Laravel Spark: Building a Subscription SaaS in Minutes

Spark Next: Subscription based application in 10 minutes

Watch

Laravel // 11:29

The official YouTube channel of Laravel, the clean stack for Artisans and agents. We will update you on what's new in the world of Laravel, from the framework to our products Cloud, Forge, and Nightwatch.

3 min read0%
3 min read