You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ParsesEnum.php 243B

123456789101112131415
  1. <?php
  2. namespace App\Enums\Concerns;
  3. trait ParsesEnum
  4. {
  5. public static function parse(string | self $value): self
  6. {
  7. if ($value instanceof self) {
  8. return $value;
  9. }
  10. return self::from($value);
  11. }
  12. }