© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
7 replies
ingmontoya

Create tenant menu

I'm trying to limit the number of tenants that a user can create, I have this code inside TeamPolicy:
public function create(): bool
    {
        $user = Auth::user();
        $tenants = $user->team;
        if (count($tenants) < Filament::getTenant()->allowedTenants()) {
            return auth()->user()->role->name === 'administrador';
        }
        return false;
    }
public function create(): bool
    {
        $user = Auth::user();
        $tenants = $user->team;
        if (count($tenants) < Filament::getTenant()->allowedTenants()) {
            return auth()->user()->role->name === 'administrador';
        }
        return false;
    }

The problem is, when the user attempts to create a new tenant (http://localhost/admin/new), the following code is returning null...

Filament::getTenant()
Filament::getTenant()

Any ideas?
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

tenant menu
FilamentFFilament / ❓┊help
2y ago
Refresh tenant menu items
FilamentFFilament / ❓┊help
16mo ago
Tenant Menu Text Options
FilamentFFilament / ❓┊help
2y ago
Customizing the tenant menu
FilamentFFilament / ❓┊help
3y ago