[ 'name' => $enum->toLabel(), 'value' => $enum->value, ], self::cases() ); } public function toLabel(): string { return match ($this) { self::ImmutableId => 'Immutable ID', self::UserIdLocal => 'User ID (Local)', self::Email => 'Email', }; } }