Support the ongoing development of Laravel.io →
posted 10 years ago
Validation
Last updated 2 years ago.
0

It's in the docs. http://laravel.com/docs/master/validation#rule-unique

look for Forcing A Unique Rule To Ignore A Given ID. that is the answer you are looking for

Last updated 2 years ago.
0

I want to ignore it only if it is the same value as the input field on the form. If the value is different, I want to validate it for a unique value.

e.g. User Settings form contains username, email and password fields. The user has the option to change their username and email, as well as password. If the input data for the username and email is the same as the data in the db, No update is necessary. If they are different, then apply the unique validation rules.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

muzikman muzikman Joined 6 Oct 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.