Laravel - Validation - Rule Enum

The Enum rule is a class based rule that validates whether the field under validation contains a valid enum value. The Enum rule accepts the name of the enum as its only constructor argument:

    
    use App\Enums\ServerStatus;
    use Illuminate\Validation\Rules\Enum;
    
    $request->validate([
        'status' => [new Enum(ServerStatus::class)],
    ]);
	
Enums are only available on PHP 8.1+.