PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, January 28, 2022

[FIXED] Integer or String for a phone number?

 January 28, 2022     laravel, laravel-5, laravel-validation, validation     No comments   

Issue

I want to know if I have to use a string or an integer for a phone number?

I have tried an integer but I have a problem in my validation.

... table->integer('phone'); ...

In my validation, I must have between 8 and 11 characters.

I have tried this, but it doesn't work:

'phone' => 'required|numeric|between:8,11',

I think the string is better?


Solution

I think the validation should be like this

'phone' => 'required|numeric|min:8|max:11',


Answered By - ashok poudel
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home
View mobile version

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing