From 4f53b28a2c4e9792f0009a68ff6ab60c5ec2107b Mon Sep 17 00:00:00 2001 From: Duncan McClean Date: Wed, 6 Nov 2024 12:13:27 +0000 Subject: [PATCH] Filter out deleted roles. --- src/Auth/Eloquent/User.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Auth/Eloquent/User.php b/src/Auth/Eloquent/User.php index db647f16b6..50c6d28cff 100644 --- a/src/Auth/Eloquent/User.php +++ b/src/Auth/Eloquent/User.php @@ -105,7 +105,7 @@ public function explicitRoles($roles = null) return $this->roles = $this->roles ?? (new Roles($this))->all()->map(function ($row) { return Role::find($row->role_id); - })->keyBy->handle(); + })->filter()->keyBy->handle(); } protected function saveRoles()