The small problem is testing a user's editing form, when I validate the data with a custom request, it generates problems when I have unique fields.
In my case, I have the email as a single field, when I edit and I do not want to modify the email, it sends me the sign that it is taken.
public function rules()
{
return [
'name' => 'required|string|min:3|max:60',
'email' => 'required|email|unique:users',
];
}
The first thing that occurred to me was to modify the Request rule where it says it is unique, but this allows me to put an email that is already in the database and does not say anything, it's fine, in my database it is also restricted and does not include it, but I would like it in that case if it is advised that it is taken
The next thing that occurred to me was to do this part in the controller, but I can not verify the existence of the email inside the database, so if I do a where I get a users if the email exists or a collection empty if not, but there I am.