FilamentF
Filament10mo ago
SmereKa

canAccessPanel how make check for different panel if I use Single Login Panel

In my case I have 4 panel and 1 of them it's auth

when in my checks I am check for 3 panel what I have if they assign to role must return true

but I have problem $panel->id() return 'auth' panel

I need panel to what i am trying log in from my auth panel

for exemple if I am truing log in to admin@admin.com
admin panel it must return in $panel->id() ''admin" not "auth" which i am geting
    public function canAccessPanel(Panel $panel): bool
    {

        return match ($panel->getId()) {
            RolesEnum::ADMIN->value => $this->hasRole(RolesEnum::ADMIN->value),
            RolesEnum::STAFF->value => $this->hasRole(RolesEnum::STAFF->value),
            RolesEnum::PLAYER->value => $this->hasRole(RolesEnum::PLAYER->value),
            default => false,
        };
    }
image.png
Was this page helpful?