-merubah cara menampilkan data dari menggunakan tabel menjadi foreach card -menghapus dispatch datatable -membuat referral code factory -menyesuaikan test
43 lines
962 B
PHP
43 lines
962 B
PHP
<?php
|
|
|
|
namespace App\Enums;
|
|
|
|
use App\Traits\WithCommentEnum;
|
|
use App\Traits\WithValueEnum;
|
|
|
|
enum UserStatus: int
|
|
{
|
|
use WithCommentEnum, WithValueEnum;
|
|
|
|
case ACTIVE = 1;
|
|
case INACTIVE = 2;
|
|
case SUSPENDED = 3;
|
|
|
|
public function label()
|
|
{
|
|
return match ($this) {
|
|
self::ACTIVE => 'Aktif',
|
|
self::INACTIVE => 'Tidak Aktif',
|
|
self::SUSPENDED => 'Suspend',
|
|
};
|
|
}
|
|
|
|
public function color()
|
|
{
|
|
return match ($this) {
|
|
self::ACTIVE => 'emerald',
|
|
self::INACTIVE => 'yellow',
|
|
self::SUSPENDED => 'red',
|
|
};
|
|
}
|
|
|
|
public function gradient(): string
|
|
{
|
|
return match ($this) {
|
|
self::ACTIVE => 'bg-gradient-to-b from-emerald-800 to-emerald-400',
|
|
self::INACTIVE => 'bg-gradient-to-b from-yellow-800 to-yellow-400',
|
|
self::SUSPENDED => 'bg-gradient-to-b from-red-800 to-red-400',
|
|
};
|
|
}
|
|
}
|