Oct 12, 2018
9
Level 5
laravel validated with integer and entered integer, but not accepting ?
Guys iam working with a project in that, in store function in resource controller i given validation integer required
'employee_phno'=>'required|integer',
and from form if i enter 9999999999(10 digits). mobile number is 10 digits.
if i give this its not accepting it showing the error
Errors:
The employee phno must be an integer.
why?
is there some other datatype to give mobile numbers which accepts 10 digits
Level 3
@ABDULBAZITH for integer Maximum Value Signed is 2147483647 and Maximum Value Unsigned 4294967295 in mysql . https://dev.mysql.com/doc/refman/8.0/en/integer-types.html
it's also depend on DB used.
To store phone number you should use
'employee_phno'=>'required|numeric',
2 likes
Please or to participate in this conversation.