Forcing A Unique Rule To Ignore A Given ID in Form Request

Posted 10 months ago by phpMick

Can someone please remind me how to do this in L5.5?

I am editing a user, the email field is unique.

Like this:

Validator::make($data, [
    'email' => [

but in a form request.

This is what I have:

 return [

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.


Please sign in or create an account to participate in this conversation.

Laracasts Mascot

Hi, Have We Met Yet?

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.

Sign Me Up


Reply to

Use Markdown with GitHub-flavored code blocks.