From f68e47e7b42c4e7a8b422bd44ab67dce2e4da6da Mon Sep 17 00:00:00 2001 From: AQuadic User <149314938+user-aquadic@users.noreply.github.com> Date: Sun, 1 Sep 2024 12:12:34 +0300 Subject: [PATCH] filament()->auth()->user() instead of auth()->user() --- src/Filament/Resources/EmailResource.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Filament/Resources/EmailResource.php b/src/Filament/Resources/EmailResource.php index c6b5a48..5b3b9aa 100644 --- a/src/Filament/Resources/EmailResource.php +++ b/src/Filament/Resources/EmailResource.php @@ -341,8 +341,8 @@ public static function canAccess(): bool { $roles = config('filament-email.can_access.role', []); - if (method_exists(auth()->user(), 'hasRole') && ! empty($roles)) { - return auth()->user()->hasRole($roles); + if (method_exists(filament()->auth()->user(), 'hasRole') && ! empty($roles)) { + return filament()->auth()->user()->hasRole($roles); } return true;