Add tenant slug to Sparks return url
I'm using miltitenantcy, and Laravel Spark. When viewing the spark billing page, how do I set the url when clicking "Return to..." link? This link returns the user to "/" but I want it to return them to "/tenant-slug" where tenant-slug is the team slug. Any ideas?
7 Replies
Follow this link , it will help you a lot https://silvanhagen.com/writing/free-users-filament-laravel-spark/
Silvan Hagen
Free users with Filament and Laravel Spark
How to handle free users in a multi-tenant Filament app using Laravel Spark and a custom Middleware.
That doesn't help me to change the return URL in spark
Bumping this.
You can change the Dashabord url from config\spark.php
Hopefully , it is what you want
I need it to send them to the team slug, e.g example.com/team-one
This is how Spark operates behind the scenes: This function retrieves the URL specified in the config/spark.php file under dashboard_url and appends it to the default URL, resulting in a complete URL. For example: https://example.com/dashboard_url."
protected function dashboardUrl()
{
if ($dashboardUrl = config('spark.dashboard_url')) {
return $dashboardUrl;
}
return app('router')->has('dashboard') ? route('dashboard') : '/';
}
If you want to explore further, you can take a look at the FrontendState.php file located in the spark directory.