26 lines
549 B
PHP
26 lines
549 B
PHP
<?php
|
|
|
|
namespace App\Enums\PraktikBudidaya;
|
|
|
|
enum TindakanPanenReject: string
|
|
{
|
|
case BUANG = 'Dibuang';
|
|
case JUAL = 'Dijual ke tempat lain';
|
|
|
|
public function label(): string
|
|
{
|
|
return match($this) {
|
|
self::BUANG => 'Dibuang',
|
|
self::JUAL => 'Dijual ke tempat lain',
|
|
};
|
|
}
|
|
|
|
public static function options(): array
|
|
{
|
|
return collect(self::cases())->map(fn ($case) => [
|
|
'value' => $case->value,
|
|
'label' => $case->label(),
|
|
])->toArray();
|
|
}
|
|
}
|