<?php

namespace App\Enums;

enum UserRole: string
{
    case User = 'user';
    case Admin = 'admin';
    case SuperAdmin = 'super_admin';

    public function label(): string
    {
        return match ($this) {
            self::User => __('enums.user_role.user'),
            self::Admin => __('enums.user_role.admin'),
            self::SuperAdmin => __('enums.user_role.super_admin'),
        };
    }

    public function isAdmin(): bool
    {
        return in_array($this, [self::Admin, self::SuperAdmin], true);
    }
}
