AI store generator for ecommerce, Malaysia first. Laravel 13 + React + TypeScript.
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace App\Enums;
  3. enum ProductStatus: string
  4. {
  5. /** Saved, but hidden from shoppers. */
  6. case Draft = 'draft';
  7. /** Shown in the store. */
  8. case Active = 'active';
  9. public function label(): string
  10. {
  11. return match ($this) {
  12. self::Draft => 'Draft',
  13. self::Active => 'Active',
  14. };
  15. }
  16. /**
  17. * @return list<array{value: string, label: string}>
  18. */
  19. public static function options(): array
  20. {
  21. return array_map(fn (self $status) => ['value' => $status->value, 'label' => $status->label()], self::cases());
  22. }
  23. }