← prev | next →
DesolatorMagno 2021-01-25 20:51:02
So the validation will be.
+911234567890 == 1234567890
Prem Soni 2021-01-25 20:51:13
DesolatorMagno 2021-01-25 20:51:02
So the validation will be.
+911234567890 == 1234567890
Yes
Joice 2021-01-25 20:51:19
Where I am making mistake..I only started laravel..I am an intern for a connay
DesolatorMagno 2021-01-25 20:51:46
Is not a Laravel problem, Is a logic problem.
Joice 2021-01-25 20:51:54
DesolatorMagno 2021-01-25 20:51:02
So the validation will be.
+911234567890 == 1234567890
Ohh…
Prem Soni 2021-01-25 20:51:57
Joice 2021-01-25 20:51:19
Where I am making mistake..I only started laravel..I am an intern for a connay
Conway?
Joice 2021-01-25 20:52:05
DesolatorMagno 2021-01-25 20:51:02
So the validation will be.
+911234567890 == 1234567890
So what should i do now
Prem Soni 2021-01-25 20:52:11
DesolatorMagno 2021-01-25 20:51:46
Is not a Laravel problem, Is a logic problem.
You are right basic logic
Joice 2021-01-25 20:52:26
How to validate that full number
Prem Soni 2021-01-25 20:52:26
It is not laravel
Joice 2021-01-25 20:52:52
+91123456789 = +91123456789
DesolatorMagno 2021-01-25 20:52:57
Make a custom validation rule. That is a way.
Prem Soni 2021-01-25 20:53:00
Joice 2021-01-25 20:52:26
How to validate that full number
You mean to keep validation if it is empty or same?
Joice 2021-01-25 20:53:48
DesolatorMagno 2021-01-25 20:52:57
Make a custom validation rule. That is a way.
Can you send any link where custom validations are done
DesolatorMagno 2021-01-25 20:53:55
Prem Soni 2021-01-25 20:53:00
You mean to keep validation if it is empty or same?
Joice need to validate that the field is unique.
Joice 2021-01-25 20:53:59
For reffering
Caleb_Fonyuy 2021-01-25 20:54:19
Joice 2021-01-25 20:27:29
When giving same phone number its throwing this error
I think the problem is at the level of the database. Your phone column is defined as unique but you’re trying to add a value that already exists in your database. That is not allowed
Caleb_Fonyuy 2021-01-25 20:54:43
So, go to your database and ensure that the phone number you’re trying to add doesn’t already exist
badralwattar 2021-01-25 20:54:47

I had this error when I uploaded pdf more than 6MB size
DesolatorMagno 2021-01-25 20:55:00
https://laravel.com/docs/8.x/validation#custom-validation-rules
Is not easy, and is one solution, there are more but that if for you to think.
Joice 2021-01-25 20:56:03
DesolatorMagno 2021-01-25 20:55:00
https://laravel.com/docs/8.x/validation#custom-validation-rules
Is not easy, and is one solution, there are more but that if for you to think.
Thanks a lot sir
DesolatorMagno 2021-01-25 20:56:11
Caleb_Fonyuy 2021-01-25 20:54:43
So, go to your database and ensure that the phone number you’re trying to add doesn’t already exist
Joice now searching for a request validation that assure whatever number he put is not already in database, the database already have the constraint for unique.
DesolatorMagno 2021-01-25 20:56:53
The unique rule does that, but Joice is fussing 2 inputs, that’s why it won’t work.
Joice 2021-01-25 20:57:49
DesolatorMagno 2021-01-25 20:56:53
The unique rule does that, but Joice is fussing 2 inputs, that’s why it won’t work.
If i do it in custom validation also..how to make that 2 inputs together
Joice 2021-01-25 20:58:01
Any clue
DesolatorMagno 2021-01-25 20:59:04
Read about custom validation, you can accept any value and extra value, try coping what unique does but just concatenate first.
Joice 2021-01-25 20:59:54
Ok
segungreat 2021-01-25 21:11:56
Joice 2021-01-25 20:59:54
Ok
I think your problem is this.
Let’s say a user entered 123456789 as phone number, but you in the code will add the dial code to it to make it and save it as +91123456789.
Now, the unique will check for 123456789 and meanwhile there is no number like that, all no’s start with +91, so the validation will pass, then when it’s time to save in the table, SQL will prompt unique constraint error because you added +91 to it and a number already exist.
The solution to your problem is custom rule as stated by @DesolatorMagno
Go through the documentation, if you did not understand, search on YouTube
segungreat 2021-01-25 21:13:37
badralwattar 2021-01-25 20:54:47
I had this error when I uploaded pdf more than 6MB size
Can you show the logic to upload the file
segungreat 2021-01-25 21:15:36
willelm 2021-01-25 19:47:55
Dont work. Why?
Put
$arr2[$I] = 1 in curly braces
segungreat 2021-01-25 21:18:16
profsr123 2021-01-25 16:29:46
yes
Check the network log in the console if the data is really sent
Joice 2021-01-25 21:20:21
segungreat 2021-01-25 21:11:56
I think your problem is this.
Let’s say a user entered 123456789 as phone number, but you in the code will add the dial code to it to make it and save it as +91123456789.
Now, the unique will check for 123456789 and meanwhile there is no number like that, all no’s start with +91, so the validation will pass, then when it’s time to save in the table, SQL will prompt unique constraint error because you added +91 to it and a number already exist.
The solution to your problem is custom rule as stated by @DesolatorMagno
Go through the documentation, if you did not understand, search on YouTube
Thank you 🙏🏻
Caleb_Fonyuy 2021-01-25 21:22:24
badralwattar 2021-01-25 20:54:47
I had this error when I uploaded pdf more than 6MB size
Check your php.ini settings to be sure that uploads for files of 6MB are allowed. By default the maximum file size allowed is 2MB.
willelm 2021-01-25 21:45:59
segungreat 2021-01-25 21:15:36
Put
$arr2[$I] = 1 in curly braces
{ $arr2[$I] = 1 } ????
segungreat 2021-01-25 23:29:08
willelm 2021-01-25 21:45:59
{ $arr2[$I] = 1 } ????
Yes
For the if statement
← prev | next →