title: Laravel | Unique validation where clause
body: <p>I am trying to validate the input of a email address that exists but only when the company_id is the same as the company_id which is passed in with the request.</p>
  
  <p>I am getting this error...</p>
  
  <blockquote>
    <p>SQLSTATE[42S22]: Column not found: 1054 Unknown column '1' in 'where clause' (SQL: select count(*) as aggregate from company_users where email_address = myemail.com and 1 &lt;> company_id)</p>
  </blockquote>
  
  <p>I have read online and the way to do it is to associate the table and the column inside of the validation which is what I am doing.</p>
  
  <p>This is my current code...</p>
  
  <pre><code>required|email|unique:company_users,email_address,company_id,' . $request-&gt;company_id
  </code></pre>