Is there a way to get the current tenant in isTenantSubscriptionRequired()?
For a Resource in the Panel, I need to get the current tenant and when implementing
isTenantSubscriptionRequired(Panel $panel)
using Filament::getTenant()
returns null. Is there a way to get the current tenant from the $panel
passed to the method in the Resource?Solution:Jump to solution
Thanks to the Filament team helping me on twitter, I was able to implement a much nicer solution. Here is how: https://silvanhagen.com/writing/free-users-filament-laravel-spark/
Silvan Hagen
Handle 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.
2 Replies
The above does work, but it's very very ugly. If anyone knows about a better way, feel free to share π
Solution
Thanks to the Filament team helping me on twitter, I was able to implement a much nicer solution. Here is how: https://silvanhagen.com/writing/free-users-filament-laravel-spark/
Silvan Hagen
Handle 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.