ValidationRuleParser
class ValidationRuleParser (View source)
Properties
array | $data | The data being validated. | |
array | $implicitAttributes | The implicit attributes. |
Methods
void | __construct(array $data) Create a new validation rule parser. | |
stdClass | explode(array $rules) Parse the human-friendly rules into a full rules array for the validator. | |
array | explodeRules(array $rules) Explode the rules into an array of explicit rules. | |
array | explodeExplicitRule(mixed $rule) Explode the explicit rule into an array if necessary. | |
mixed | prepareRule(mixed $rule) Prepare the given rule for the Validator. | |
array | explodeWildcardRules(array $results, string $attribute, string|array $rules) Define a set of rules that apply to each element in an array attribute. | |
array | mergeRules(array $results, string|array $attribute, string|array $rules = []) Merge additional rules into a given attribute(s). | |
array | mergeRulesForAttribute(array $results, string $attribute, string|array $rules) Merge additional rules into a given attribute. | |
static array | parse(array|string $rules) Extract the rule name and parameters from a rule. | |
static array | parseArrayRule(array $rules) Parse an array based rule. | |
static array | parseStringRule(string $rules) Parse a string based rule. | |
static array | parseParameters(string $rule, string $parameter) Parse a parameter list. | |
static string | normalizeRule(string $rule) Normalizes a rule so that we can accept short types. |
Details
void __construct(array $data)
Create a new validation rule parser.
stdClass explode(array $rules)
Parse the human-friendly rules into a full rules array for the validator.
protected array explodeRules(array $rules)
Explode the rules into an array of explicit rules.
protected array explodeExplicitRule(mixed $rule)
Explode the explicit rule into an array if necessary.
protected mixed prepareRule(mixed $rule)
Prepare the given rule for the Validator.
protected array explodeWildcardRules(array $results, string $attribute, string|array $rules)
Define a set of rules that apply to each element in an array attribute.
array mergeRules(array $results, string|array $attribute, string|array $rules = [])
Merge additional rules into a given attribute(s).
protected array mergeRulesForAttribute(array $results, string $attribute, string|array $rules)
Merge additional rules into a given attribute.
static array parse(array|string $rules)
Extract the rule name and parameters from a rule.
static protected array parseArrayRule(array $rules)
Parse an array based rule.
static protected array parseStringRule(string $rules)
Parse a string based rule.
static protected array parseParameters(string $rule, string $parameter)
Parse a parameter list.
static protected string normalizeRule(string $rule)
Normalizes a rule so that we can accept short types.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.7/Illuminate/Validation/ValidationRuleParser.html