Answer the question
In order to leave comments, you need to log in
How to fix regular expression validation error in Laravel 5?
Good day. I am learning Laravel. When validating data, forms will run into a problem. One of the fields needs to be checked against a regular expression. The corresponding validator method is present in the documentation, but when executed, I catch an exception that this method is missing.
BadMethodCallException in Validator.php line 2615:
Method [validateRegexp] does not exist.
static public $rules = array(
'node' => array(
'required',
'unique:com_object',
'regexp:/^ПРП\w+-\w+$|^АО\w+$|^ПВН\w+-\w+$/i'
),
'street' => 'required'
);
...
$validation = Validator::make($data, Node::$rules,Node::$messages);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question