mapWithKeys(fn (Role $r) => [self::$roles[$r->value] => $r->name]) ->mapWithKeys(fn (Role $r) => [$r->value => $r->name]) ->toArray(); } private static function initCache(): void { if (empty(self::$roles)) { self::$roles = SpatieRole::pluck('id', 'name')->toArray(); } } }