lundi 23 mai 2016

Laravel validator not differntiating between number and string

I have controller whose validator is

$validator = \Validator::make($request->all(),[
        'activation_status' =>'required|in:0,1|integer',
        'is_tkr' =>'required|in:0,1|integer',
     ]);

but even if I pass string that is '0' or '1' it still passes. What is that i am doing wrong?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire