Mastering Laravel Spark: Building a Subscription SaaS in Minutes
Overview of Next-Generation 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 , , or simple templates—without the billing logic cluttering your UI.
Prerequisites and Toolkit
To follow this implementation, you should be comfortable with the framework and basic terminal operations.
Key Libraries & Tools
- : A minimal, simple starter kit for scaffolding authentication.
- : A merchant of record that handles VAT taxes and provides integration.
- : The alternative payment provider supported by Spark.
- : The utility-first CSS framework used for branding the portal.
Implementation Walkthrough
Start by scaffolding authentication using . Once your users can log in, install the edition of Spark via :
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 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 ) happens in the branding section of the config. You can swap the logo and primary button colors using 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; 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.
- 16%· companies
- 11%· software
- 11%· software
- 11%· software
- 5%· people
- Other topics
- 47%

Spark Next: Subscription based application in 10 minutes
WatchLaravel // 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.