F
Filament5mo ago
Satal

Remove Manage Subscription from tenant menu

I have a multi-tenant application and I'm using Laravel Spark for billing. In my AppPanelProvider I have the following:
->tenantMenuItems([
'register' => MenuItem::make()
->label('Register New Website'),
'profile' => MenuItem::make()
->label('Edit Website'),
'subscription' => MenuItem::make()
->label('Manage subscription')
->url('/billing')
->icon('heroicon-s-credit-card')
->visible(false),
])
->userMenuItems(
[
'subscription' => MenuItem::make()
->label('Manage subscription')
->url('/billing')
->icon('heroicon-s-credit-card'),
]
)
->tenantMenuItems([
'register' => MenuItem::make()
->label('Register New Website'),
'profile' => MenuItem::make()
->label('Edit Website'),
'subscription' => MenuItem::make()
->label('Manage subscription')
->url('/billing')
->icon('heroicon-s-credit-card')
->visible(false),
])
->userMenuItems(
[
'subscription' => MenuItem::make()
->label('Manage subscription')
->url('/billing')
->icon('heroicon-s-credit-card'),
]
)
No matter what I do I can't seem to get the tenantMenuItem for managing subscription to go from the front end (screenshot showing what I mean). I have it under userMenuItems, which is where I want it but I've tried the following and I can't get rid of it: 1. Remove the code from tenantMenuItems, no impact 2. Set the visibility to false, no impact Does anyone have any other ideas about how to remove the entry in the tenant menu?
No description
Solution:
Yes, probably Spark... Did you create the /billing route by yourself? You may want to try commenting this line in you Panel: ->tenantBillingProvider(new SparkBillingProvider()); and see if the link is still present......
Jump to solution
7 Replies
micraux
micraux5mo ago
I don't know if I am understanding right, but as you defined 2 identical menu entries (subscription), you may see the second when you hide the first, no? Could you try just renaming your entries, like: Manage subscription (tenant) and Manage subscription (user) for better understanding/debugging?
Satal
SatalOP5mo ago
Hi @micraux sorry, I confused things with how I was showing the code. If I remove "Manage subscription" from the tenantMenuItems
->tenantMenuItems([
'register' => MenuItem::make()
->label('Register New Website'),
'profile' => MenuItem::make()
->label('Edit Website'),
])
->userMenuItems(
[
'subscription' => MenuItem::make()
->label('Manage subscription1') //note it now says subscription1
->url('/billing')
->icon('heroicon-s-credit-card'),
]
)
->tenantMenuItems([
'register' => MenuItem::make()
->label('Register New Website'),
'profile' => MenuItem::make()
->label('Edit Website'),
])
->userMenuItems(
[
'subscription' => MenuItem::make()
->label('Manage subscription1') //note it now says subscription1
->url('/billing')
->icon('heroicon-s-credit-card'),
]
)
However, in the tenant menu, I'm still getting the "Manage subscription" option as well as the "Manage subscription1" in the user menu. I've attached screenshots of the tenant menu and the user menu.
No description
No description
micraux
micraux5mo ago
Oh I see, quite strange.. I wonder where the "Manage subscription" (from Tenant menu) comes from!
Dennis Koch
Dennis Koch5mo ago
Is this coming from a Filament Plugin?
Satal
SatalOP5mo ago
I don't think so but I can't think where else it would be coming from. Below is a list of the composer packages that the project has. Spark billing provider seems the most likely, but I can't find anything that seems to suggest it will do that automatically.
"php": "^8.1",
"blade-ui-kit/blade-heroicons": "^2.3",
"blade-ui-kit/blade-ui-kit": "^0.6.2",
"coderflex/laravel-turnstile": "^2.0",
"filament/filament": "^3.0-stable",
"filament/spark-billing-provider": "^3.0",
"filament/spatie-laravel-media-library-plugin": "^3.2",
"guzzlehttp/guzzle": "^7.2",
"laravel/framework": "^10.10",
"laravel/jetstream": "^4.0",
"laravel/sanctum": "^3.2",
"laravel/spark-stripe": "^5.3",
"laravel/tinker": "^2.8",
"owenvoke/blade-fontawesome": "^2.6",
"spatie/laravel-medialibrary": "^11.5",
"spatie/laravel-sluggable": "^3.6",
"stancl/tenancy": "^3.7"
"php": "^8.1",
"blade-ui-kit/blade-heroicons": "^2.3",
"blade-ui-kit/blade-ui-kit": "^0.6.2",
"coderflex/laravel-turnstile": "^2.0",
"filament/filament": "^3.0-stable",
"filament/spark-billing-provider": "^3.0",
"filament/spatie-laravel-media-library-plugin": "^3.2",
"guzzlehttp/guzzle": "^7.2",
"laravel/framework": "^10.10",
"laravel/jetstream": "^4.0",
"laravel/sanctum": "^3.2",
"laravel/spark-stripe": "^5.3",
"laravel/tinker": "^2.8",
"owenvoke/blade-fontawesome": "^2.6",
"spatie/laravel-medialibrary": "^11.5",
"spatie/laravel-sluggable": "^3.6",
"stancl/tenancy": "^3.7"
Anyone have any thoughts on what might be causing it? I'm starting to think I'm going to have to write some JS to hide it in the front end but I would much rather figure out why it's showing.
Solution
micraux
micraux5mo ago
Yes, probably Spark... Did you create the /billing route by yourself? You may want to try commenting this line in you Panel: ->tenantBillingProvider(new SparkBillingProvider()); and see if the link is still present...
Satal
SatalOP4mo ago
@micraux sorry for the slow response. Thanks for this. I'm not sure why, but initially, when I removed it, the application wouldn't work, but it seems fine now. I blame user error 😄
Want results from more Discord servers?
Add your server