<?php

namespace Lucent\Validator;

use Illuminate\Support\Facades\Validator as LaravelValidator;
use Lucent\LucentException;

class Validator
{

    public static function single(string $label, string $value, string $rules): void
    {
        $val = LaravelValidator::make([$label => $value], [
            $label => $rules,
        ]);

        if ($val->fails()) {
            throw new LucentException($val->errors()->first());
        }
    }
}
