Disable creation of new tenants

Is it possible to disable the creation of new tenants in some way? I want to limit the amount of tenants a user can make
3 Replies
khairulazmi_
khairulazmi_9mo ago
Hi bro did you find a way to do this ?
jaocero
jaocero9mo ago
Bumping this as I need also to disable creating tenant if I reach a certain limit
khairulazmi_
khairulazmi_9mo ago
Thinking to do something like this .. but inside PanelProvider we cant get tenant response ..
->tenant(Team::class, slugAttribute: 'slug')
->when(Filament::getTenant()->count < 3 ? true : false,function ($panel){

$panel->tenantRegistration(RegisterTeam::class);

})
->tenantProfile(EditTeamProfile::class)
->tenant(Team::class, slugAttribute: 'slug')
->when(Filament::getTenant()->count < 3 ? true : false,function ($panel){

$panel->tenantRegistration(RegisterTeam::class);

})
->tenantProfile(EditTeamProfile::class)
->tenantMenuItems([
'register' => MenuItem::make()->label('Register new gilateam')->visible(fn(): bool => count(Filament::getUserTenants(auth()->user())) <= 2),
])
->tenantMenuItems([
'register' => MenuItem::make()->label('Register new gilateam')->visible(fn(): bool => count(Filament::getUserTenants(auth()->user())) <= 2),
])
I think this will do, what you think @jaocero ?
Want results from more Discord servers?
Add your server