enums sosial ekonomi

This commit is contained in:
2026-07-07 15:41:02 +07:00
parent b3d805fe98
commit 2eb40f8a1a
15 changed files with 451 additions and 108 deletions
+27
View File
@@ -0,0 +1,27 @@
<?php
namespace App\Enums;
enum StatusKonflik: string
{
case SUDAH_SELESAI = 'Sudah selesai';
case BELUM_MASIH_BERLANJUT = 'Belum, masih berlanjut';
public function label(): string
{
return $this->value;
}
public static function options(): array
{
return collect(self::cases())->map(fn ($case) => [
'value' => $case->value,
'label' => $case->label(),
])->toArray();
}
public static function values(): array
{
return array_column(self::cases(), 'value');
}
}