<?php

namespace App\Enums;

enum UserRole: string
{
    case Admin  = 'admin';
    case Member = 'member';

    // Returns a human-readable label
    public function label(): string
    {
        return match($this) {
            UserRole::Admin  => 'Administrator',
            UserRole::Member => 'Member',
        };
    }

    // Returns all values as a plain array — useful for validation rules
    public static function values(): array
    {
        return array_column(self::cases(), 'value');
    }
}
