Files

32 lines
1021 B
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
namespace App\Enums\PraktikBudidaya;
enum TingkatPanenReject: int
{
case SERING = 1;
case CUKUP_SERING = 2;
case KADANG = 3;
case JARANG = 4;
case TIDAK_ADA = 5;
public function label(): string
{
return match($this) {
self::SERING => 'Sering ditolak, lebih dari 50% hasil panen biasanya ditolak/tidak laku karena mutu',
self::CUKUP_SERING => 'Cukup sering, sekitar 25–50% hasil panen ditolak/tidak laku',
self::KADANG => 'Kadang ditolak, sekitar 10–25% hasil panen',
self::JARANG => 'Jarang ditolak, kurang dari 10% hasil panen',
self::TIDAK_ADA => 'Tidak ada yang ditolak, semua hasil panen sesuai standar pasar utama',
};
}
public static function options(): array
{
return collect(self::cases())->map(fn ($case) => [
'value' => $case->value,
'label' => $case->label(),
])->toArray();
}
}