From ae351bfdafdf791a9c39aa7f2fbdb49a8253a26d Mon Sep 17 00:00:00 2001 From: xiaomlove Date: Mon, 27 Jun 2022 17:33:40 +0800 Subject: [PATCH] nexus_config can access filament --- app/Models/User.php | 3 +-- include/globalfunctions.php | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Models/User.php b/app/Models/User.php index ada79bd4..0c02232d 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -104,8 +104,7 @@ class User extends Authenticatable implements FilamentUser, HasName public function canAccessFilament(): bool { - return true; -// return str_ends_with($this->email, '@yourdomain.com') && $this->hasVerifiedEmail(); + return $this->class >= self::CLASS_ADMINISTRATOR; } public function getFilamentName(): string diff --git a/include/globalfunctions.php b/include/globalfunctions.php index 6f99d263..a2b7ad47 100644 --- a/include/globalfunctions.php +++ b/include/globalfunctions.php @@ -265,6 +265,7 @@ function nexus_config($key, $default = null) $files = [ ROOT_PATH . 'config/nexus.php', ROOT_PATH . 'config/emoji.php', + ROOT_PATH . 'config/filament.php', ]; foreach ($files as $file) { $basename = basename($file);