You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
518 B
27 lines
518 B
<?php
|
|
|
|
namespace App\Domains\Identity\Enums;
|
|
|
|
enum UserStatus: string
|
|
{
|
|
case ACTIVE = 'active';
|
|
case INACTIVE = 'inactive';
|
|
|
|
public function label(): string
|
|
{
|
|
return __('domains/identity/enum.user_status.'.$this->value);
|
|
}
|
|
|
|
public function badgeVariant(): string
|
|
{
|
|
return match ($this) {
|
|
self::ACTIVE => 'success',
|
|
self::INACTIVE => 'danger',
|
|
};
|
|
}
|
|
|
|
public function isActive(): bool
|
|
{
|
|
return $this == self::ACTIVE;
|
|
}
|
|
}
|
|
|