'Русский', self::En => 'English' }; } public function getLocale(): string { return match ($this) { self::Ru => 'ru', self::En => 'en' }; } public static function toArray(): array { $choices = []; foreach (self::cases() as $lang) { $choices[] = [ 'name' => $lang->name, 'value' => $lang->value, 'title' => $lang->getTitle(), 'locale' => $lang->getLocale() ]; } return $choices; } public static function toCollection(): Collection { return collect(self::toArray()); } }