Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unique_encrypted doesn't support "except" or "idColumn" constraints #1

Open
conroyp opened this issue Jul 3, 2019 · 0 comments
Open

Comments

@conroyp
Copy link

conroyp commented Jul 3, 2019

https://laravel.com/docs/5.8/validation#rule-unique

Laravel's validation rules allow for except conditions to be passed to a rule. This allows for validation rules on an update of a user account to ensure that the user's email address is unique, excluding their own user record. This can be done via Rule objects, or by adding the exceptional values to the piped-format validation rule string.

The syntax would look something like:

'email' => 'required|email|unique:users,email,'.$user_id,

When using the unique_encrypted validation rule, only the first two parameters get handled. This means that an attempt to update a user record by posting a full user object will throw a validation error due to the email address already existing in the database.

magros pushed a commit that referenced this issue Jan 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant