When you put the required
option in the validation rules of Laravel
$validator=\Validator::make($request->all(),['po_bairro'=>'require|string|min:5|max:50']);
It requires you to have the value to continue the program.
However, in my case, I did not put 'require' as an option. I only set%% of% in the rules.
$validator=\Validator::make($request->all(),['po_bairro'=>'string|min:5|max:50']);
By submitting the form with the empty field ( string|min:5|max:50
), it gives me the error of the po_bairro
rule.
Here comes the question, but I do not require, the validator should not let pass?