I am validating number field below code is working fine. It is checking the characters should not be more then 2 or less, which is fine for me.
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'id' => 'required|min:2|max:2',
'title' => 'required'
];
}
But when I add more validation rule like (numeric), min and max validaiton rules get changed, now it is being checked by the numeric number should not be greater than 2... WHY? IS IT BUG?
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'id' => 'required|min:2|max:2|numeric',
'title' => 'required'
];
}
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire