Answer the question
In order to leave comments, you need to log in
Why doesn't the validator allow fields to be left blank?
Hello. I have this validator:
public function rules()
{
return [
'content' =>'required|max:50' ,
'port' =>'sometimes|numeric|max:5' ,
'weight' =>'sometimes|numeric|max:5' ,
'priority'=>'sometimes|numeric|max:2' ,
'host'=>'required|max:30' ,
'target'=>'sometimes|url|max:30'
];
}
The port must be a number.
The priority must be a number.
The target format is invalid.
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