validation on exact length of numeric field in laravel 5 -


i have numeric field want validate on exact fill 4 digits.

like: 1234, 4567,1245

but these invalid inputs: like: 123, 346, 45m6, 34567

what trying:

'last4digits'             => 'numeric|between:4,4', 

you looking digits rule. from docs:

the field under validation must numeric , must have exact length of value.

'last4digits' => 'digits:4' 

Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -