Skip to content

canAccessPanel for multiple panels #12838

Answered by leandrocfe
Ssionn asked this question in Help
Discussion options

You must be logged in to vote

use $panel->getId()

public function canAccessPanel(Panel $panel): bool
{
    return match($panel->getId()) {
        default => false,
        'admin' => str_ends_with($this->email, '@example.com'),
    };
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Ssionn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants