From 6b0fbe47c28c4b855401682a1fb277d5fc3aaeed Mon Sep 17 00:00:00 2001 From: Yoga Pangestu Date: Thu, 2 Oct 2025 11:09:58 +0700 Subject: [PATCH] refactor(enums): menghapus icon dan menyesuaikan di inputnya --- app/Enums/Gender.php | 8 -------- app/Enums/IsActive.php | 8 -------- app/Enums/OutletStatus.php | 9 --------- app/Enums/UserStatus.php | 9 --------- app/Enums/VoucherType.php | 8 -------- resources/views/livewire/auth/register.blade.php | 2 +- .../views/livewire/studio/loyalty/customers.blade.php | 2 +- .../views/livewire/studio/loyalty/voucher/form.blade.php | 4 ++-- .../views/livewire/studio/master/outlet/form.blade.php | 2 +- .../views/livewire/studio/master/user/form.blade.php | 4 ++-- 10 files changed, 7 insertions(+), 49 deletions(-) diff --git a/app/Enums/Gender.php b/app/Enums/Gender.php index 2c02a85..d156597 100644 --- a/app/Enums/Gender.php +++ b/app/Enums/Gender.php @@ -26,12 +26,4 @@ public function color() self::FEMALE => 'pink', }; } - - public function icon() - { - return match ($this) { - self::MALE => 'mars', - self::FEMALE => 'venus', - }; - } } diff --git a/app/Enums/IsActive.php b/app/Enums/IsActive.php index 9fbd3a9..13628d0 100644 --- a/app/Enums/IsActive.php +++ b/app/Enums/IsActive.php @@ -27,12 +27,4 @@ public function color() self::INACTIVE => 'red', }; } - - public function icon() - { - return match ($this) { - self::ACTIVE => 'check-circle', - self::INACTIVE => 'x-circle', - }; - } } diff --git a/app/Enums/OutletStatus.php b/app/Enums/OutletStatus.php index c792a7e..b79be75 100644 --- a/app/Enums/OutletStatus.php +++ b/app/Enums/OutletStatus.php @@ -30,13 +30,4 @@ public function color() self::TERMINATED => 'red', }; } - - public function icon() - { - return match ($this) { - self::OPERATIONAL => 'check-circle', - self::UNDER_CONSTRUCTION => 'wrench-screwdriver', - self::TERMINATED => 'x-circle', - }; - } } diff --git a/app/Enums/UserStatus.php b/app/Enums/UserStatus.php index 87b11b9..01986bd 100644 --- a/app/Enums/UserStatus.php +++ b/app/Enums/UserStatus.php @@ -30,13 +30,4 @@ public function color() self::SUSPENDED => 'red', }; } - - public function icon() - { - return match ($this) { - self::ACTIVE => 'check-circle', - self::INACTIVE => 'x-circle', - self::SUSPENDED => 'ban', - }; - } } diff --git a/app/Enums/VoucherType.php b/app/Enums/VoucherType.php index 8fffc41..554b68d 100644 --- a/app/Enums/VoucherType.php +++ b/app/Enums/VoucherType.php @@ -27,12 +27,4 @@ public function color() self::PERCENTAGE => 'pink', }; } - - public function icon() - { - return match ($this) { - self::FIXED => 'currency-dollar', - self::PERCENTAGE => 'percent-badge', - }; - } } diff --git a/resources/views/livewire/auth/register.blade.php b/resources/views/livewire/auth/register.blade.php index 743ad18..d32644e 100644 --- a/resources/views/livewire/auth/register.blade.php +++ b/resources/views/livewire/auth/register.blade.php @@ -73,7 +73,7 @@ class="transition-all duration-500 ease-in-out {{ $currentStep === $step['id'] ? @foreach (\App\Enums\Gender::cases() as $gender) - + {{ $gender->label() }} @endforeach diff --git a/resources/views/livewire/studio/loyalty/customers.blade.php b/resources/views/livewire/studio/loyalty/customers.blade.php index bf2d66f..b3c37e1 100644 --- a/resources/views/livewire/studio/loyalty/customers.blade.php +++ b/resources/views/livewire/studio/loyalty/customers.blade.php @@ -35,7 +35,7 @@ Jenis Kelamin * @foreach (\App\Enums\Gender::cases() as $gender) - + {{ $gender->label() }} @endforeach diff --git a/resources/views/livewire/studio/loyalty/voucher/form.blade.php b/resources/views/livewire/studio/loyalty/voucher/form.blade.php index 68e838e..2c4cb45 100644 --- a/resources/views/livewire/studio/loyalty/voucher/form.blade.php +++ b/resources/views/livewire/studio/loyalty/voucher/form.blade.php @@ -90,7 +90,7 @@ class="**:data-[slot=content]:min-h-[100px]!" /> Jumlah Diskon * @foreach (\App\Enums\VoucherType::cases() as $item) - + {{ $item->label() }} @endforeach @@ -135,7 +135,7 @@ class="**:data-[slot=content]:min-h-[100px]!" /> @foreach (\App\Enums\IsActive::cases() as $item) - + {{ $item->label() }} @endforeach diff --git a/resources/views/livewire/studio/master/outlet/form.blade.php b/resources/views/livewire/studio/master/outlet/form.blade.php index 0c6b617..310cdce 100644 --- a/resources/views/livewire/studio/master/outlet/form.blade.php +++ b/resources/views/livewire/studio/master/outlet/form.blade.php @@ -80,7 +80,7 @@ @foreach (\App\Enums\OutletStatus::cases() as $status) - + {{ $status->label() }} @endforeach diff --git a/resources/views/livewire/studio/master/user/form.blade.php b/resources/views/livewire/studio/master/user/form.blade.php index c07e0df..7c19c26 100644 --- a/resources/views/livewire/studio/master/user/form.blade.php +++ b/resources/views/livewire/studio/master/user/form.blade.php @@ -97,7 +97,7 @@ Jenis Kelamin * @foreach (\App\Enums\Gender::cases() as $gender) - + {{ $gender->label() }} @endforeach @@ -111,7 +111,7 @@ Status * @foreach (\App\Enums\UserStatus::cases() as $status) - + {{ $status->label() }} @endforeach