title: Laravel postgres sql Case Insensitive Like
body: <p>I have a postgres sql query in Laravel : </p>
  
  <pre><code>$_query = Article::join('users', 'articles.user_id', '=', 'users.id')
                      -&gt;select('users.*','articles.*');                           
  if( array_key_exists('title', $parameters) &amp;&amp; $parameters['title'] != '' )       
          $_query-&gt;whereRaw( " LOWER(nbl_region_ref.region) like LOWER('%?%')", array( trim($parameters['region']) ) );
  $result = $_query-&gt;get();
  </code></pre>
  
  <p>Output/Error: 'PDOException' with message 'SQLSTATE[42P18]: Indeterminate datatype: 7 ERROR:  could not determine data type of parameter $2'</p>
  
  <p>Tried Query builder : </p>
  
  <pre><code>$_query= DB::select("select users.*, articles.* from articles")
                  -&gt;join('users', 'articles.user_id', '=', 'users.id');
  if( array_key_exists('title', $parameters) &amp;&amp; $parameters['title'] != '' )       
              $_query-&gt;where( "articles.title","ILIKE", array( trim($parameters['title']) ) );
      $result = $_query-&gt;get();
  </code></pre>
  
  <p>Output : Invalid FROM.. table not found</p>
  
  <p>Tried ILike (Based on a similar question without a join)</p>
  
  <pre><code>$_query = Article::join('users', 'articles.user_id', '=', 'users.id')
                  -&gt;select('users.*','articles.*');                           
  if( array_key_exists('title', $parameters) &amp;&amp; $parameters['title'] != '' )       
                  $_query-&gt;where( "articles.title","ILIKE", array( trim($parameters['title']) ) );
  </code></pre>
  
  <p>Output : Empty array</p>
  
  <p>Tried :</p>
  
  <pre><code> $_query = Article::join('users', 'articles.user_id', '=', 'users.id')
                          -&gt;select('users.*','articles.*');                           
  
  $_query-&gt;where( function ( $_queryTemp ) use ( $parameters ) {
  if( array_key_exists('title', $parameters) &amp;&amp; $parameters['title'] != '' )       
              $_query-&gt;whereRaw( " LOWER(nbl_region_ref.region) like LOWER('%?%')", array( trim($parameters['region']) ) );
  });
  </code></pre>
  
  <p>Output/Error: 'PDOException' with message 'SQLSTATE[42P18]: Indeterminate datatype: 7 ERROR:  could not determine data type of parameter $2'</p>
  
  <p>I have to make a case-insensitive search query based on the input parameter.</p>