title: Pgsql error: You might need to add explicit type casts
body: <p>My website is just working fine til i deployed it to heroku and the problem is heroku uses pgsql and I'm using mysql and laravel framework.</p>
  
  <p>my query is </p>
  
  <pre><code>$patient = Patient::where('patient_address', 'ILIKE' ,'%' . $request-&gt;input)-&gt;where('patient_sex', 'ILIKE' ,'%' . $request-&gt;gender)-&gt;whereHas('users', function($q) use($vaccine_id){
          $q-&gt;where('vaccine_id','ILIKE','%' . $vaccine_id);
      })-&gt;get();
  </code></pre>
  
  <p>here's what I'm getting when I deploy it to heroku</p>
  
  <p><code>SQLSTATE[42883]: Undefined function: 7 ERROR: operator does not exist: integer ~~* unknown
  LINE 1: ...ient_id" = "patients"."PatientID" and "vaccine_id" ILIKE $3)</code></p>
  
  <p><code>HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts. (SQL: select * from "patients" where "patient_address" ILIKE %San Francisco and "patient_sex" ILIKE % and exists (select * from "vaccines" inner join "immunizations" on "vaccines"."VaccineID" = "immunizations"."vaccine_id" where "immunizations"."patient_id" = "patients"."PatientID" and "vaccine_id" ILIKE %))</code></p>
  
  <p>I have tried using cast like CAST(vaccine_id AS VARCHAR) and I' not getting the error but it doesnt return any result.</p>