*/ public static function asOptions(): array { return array_map(fn (self $enum) => [ 'name' => $enum->toLabel(), 'value' => $enum->value, 'hint' => $enum->toHint(), ], self::cases()); } public function toLabel(): string { return match ($this) { self::Everyone => 'Everyone', self::Role => 'Role', }; } public function toHint(): string { return match ($this) { self::Everyone => 'Everyone can access the application.', self::Role => 'Only users with the specified role can access the application.', }; } }