From 5654ab6c270c4687a32abc87646bcf7c91209db7 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 22 Sep 2026 22:41:00 +0930 Subject: [PATCH] fix: viewPulse gate denies admins due to strict === on boolean is_admin is_admin is cast to bool on the User model, so $user->is_admin === 1 is always false and the gate 403s every user, admins included. Use a boolean check, consistent with the viewHorizon gate. --- app/Providers/AppServiceProvider.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index d8a563a3b..a98826628 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -112,7 +112,9 @@ class AppServiceProvider extends ServiceProvider Event::listen(Failed::class, LogFailedLogin::class); Gate::define('viewPulse', function (User $user) { - return $user->is_admin === 1; + // is_admin is cast to bool on the User model, so a strict `=== 1` + // never matches. Use a boolean check, consistent with viewHorizon. + return (bool) $user->is_admin === true; }); if (config('pulse.enabled', false)) {