src/SellerLabs/Nucleus/Validation/Validator.php
public static function spec(
        $constraints,
        $defaults = [],
        $required = [],
        $messages = []
    ) {
        return new static(
            Spec::define($constraints, $defaults, $required),
            $messages
        );
    }
public static function spec(
        $constraints,
        $defaults = [],
        $required = [],
        $messages = []
    ) {
        return new static(
            Spec::define($constraints, $defaults, $required),
            $messages
        );
    }
public static function spec ( $ constraints , $ defaults = [ ] , $ required = [ ] , $ messages = [ ] ) { return new static ( Spec :: define ( $ constraints , $ defaults , $ required ) , $ messages ) ; }
Shortcut for defining a validator using a Spec.

@param array $constraints
@param array $defaults
@param array $required
@param array $messages

@return static
Shortcut for defining a validator using a Spec .