canAccessPanel for multiple panels #12838
-
PackagePanel builder Package Versionv.3.0.0 How can we help you?I'm relatively new to filament. How exactly can I give the canAccessPanel function rules for a specific panel? For example, I have two panels. One for the user and one for the admin, yet for the one below, I want to only add for the admin panel. How would I go about this?
|
Beta Was this translation helpful? Give feedback.
Answered by
leandrocfe
May 17, 2024
Replies: 1 comment 1 reply
-
use public function canAccessPanel(Panel $panel): bool
{
return match($panel->getId()) {
default => false,
'admin' => str_ends_with($this->email, '@example.com'),
};
} |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Ssionn
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
use
$panel->getId()