diff --git a/src/helpers/Types.php b/src/helpers/Types.php index 78649b9..60d58c7 100644 --- a/src/helpers/Types.php +++ b/src/helpers/Types.php @@ -18,4 +18,13 @@ public function toString(): string self::PASSPORT => 'Pasaporte', }; } + + public function fromString(string $string): self + { + return match ($string) { + 'RNC' => self::RNC, + 'Cédula' => self::CEDULA, + 'Pasaporte' => self::PASSPORT, + }; + } }