Can someone please remind me how to do this in L5.5?
I am editing a user, the email field is unique.
Validator::make($data, [ 'email' => [ 'required', Rule::unique('users')->ignore($user->id), ], ]);
but in a form request.
This is what I have:
return [ 'name'=>'required', 'email'=>'required|email|unique:users,email' }
It looks like I need the $user->id but I don't have the $user in my form request.
Pretty sure I have done this before.
Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.