title: Laravel: using WHERE CONCAT in query
body: <p>I am pretty new to laravel and facing a problem building a query using CONCAT:</p>
  
  <pre><code>#From input
  $password = $request-&gt;password;
  #sql statement
  UserMainTbl::where('username', '=', $username)-&gt;whereRaw('hashkey', '=', CONCAT('admin_id'.$password))
  </code></pre>
  
  <p>Table: UserMainTbl<br/>
  Field: username, hashkey, admin_id</p>
  
  <p>Got error:</p>
  
  <blockquote>
    <p>Call to undefined function App\Http\Controllers\Auth\CONCAT()</p>
  </blockquote>
  
  <p>------<br/>
  <em>Update</em>:<br>
  I change my code and manage to stop the above error. But getting new error.</p>
  
  <pre><code>-&gt;where('hashkey', '=', DB::raw('concat(admin_id,"$password")'))
  </code></pre>
  
  <blockquote>
    <p>Column not found: 1054 Unknown column 'password123' in 'where clause' (SQL: select * from <code>user_main_tbl</code> where <code>username</code> = xxx and <code>hashkey</code> = concat(admin_id,password123) limit 1)</p>
  </blockquote>
  
  <p>------<br/>
  <em>Update [Solve]</em>:<br>
  My bad on this one. It is just a simple string. Here is the solution for future reference, if any. Lol:</p>
  
  <pre><code>-&gt;where('hashkey', '=', DB::raw('concat(admin_id,"'.$password.'")'))
  </code></pre>
  
  <p><br/>
  Can someone help to point how can I do it right?<br/>
  Many thanks.</p>