title: User ID parameter in Laravel Request
body: <p>I have an admin where he is able to create and update users. I made a new Form request called <code>UserUpdateRequest</code>. How can I pass the user id so that it can update user detail? Here are my rules:</p>
  <pre class="lang-php prettyprint-override"><code>// UserUpdateRequest 
  public function rules()
  {
      return [
          'firstname' =&gt; 'required|min:2|max:255',
          'lastname' =&gt; 'required|min:2|max:255',
          'username' =&gt; 'required|max:255',
          'password' =&gt; 'required|min:6|confirmed',
          'email' =&gt; 'required|email|max:255|unique:users,email,????',
          'contact' =&gt; 'required|integer',
          'gender' =&gt; 'required|in:m,f',
          'role_id' =&gt; 'required|exists:roles,id',
      ];
  }
  
  // Controller
  public function update(UserUpdateRequest $request, User $user)
  {
      $user-&gt;update([
          'firstname' =&gt; request('firstname'),
          'lastname' =&gt; request('lastname'),
          'username' =&gt; request('username'),
          'email' =&gt; request('email'),
          'contact' =&gt; request('contact'),
          'gender' =&gt; request('gender'),
          'role_id' =&gt; request('role_id'),
      ]);
  
      session()-&gt;flash('message', 'User has been successfully added.');
  
      return redirect('/users/' . $user-&gt;id);
  }
  </code></pre>
  <p><code>'required|email|max:255|unique:users,email,????',</code> is where I am confused.</p>