attributes->get(Authenticate::USER)['user_uid'] ?? null; if (! $uid || ! $this->isAdmin($uid)) { throw new AuthorizationException; } return $next($request); } private function isAdmin(string $uid): bool { if ($uid === config('mint.admin.root_uuid')) { return true; } $roles = json_decode((string) UserInfo::where('userid', $uid)->value('role'), true); return is_array($roles) && array_intersect(self::ROLES, $roles) !== []; } }