When building a subscription based application, you will commonly need to restrict access to certain routes to users that have an active subscription. For example, you may not want to let a user create a project if they are not subscribed to a billing plan. For that reason, Spark provides a convenient subscription verification middleware that you may assign to your application’s routes. If your application uses Laravel 11’s streamlined application structure which configures middleware within theDocumentation Index
Fetch the complete documentation index at: https://spark.laravel.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
bootstrap/app.php file, then Spark’s subscription verification middleware alias is automatically registered for you internally. However, if you are using an application structure that does not utilize the bootstrap/app.php file for middleware configuration, you may need to manually register the subscribed middleware alias in your application’s App\Http\Kernel class:
subscribed middleware to any of your application’s route definitions:
Of course, you may always manually inspect a billable model’s subscription status using the methods provided by Laravel Cashier, which can be especially useful for verifying that a user is subscribed to a particular plan.