title: Laravel 5 string as primary key
body: <p>I'm working on a project that uses Laravel 5.5 and one of the models has its ID defined by the user. Below the model, setting <code>$incrementing</code> to false and having it in the <code>$fillable</code> array.</p>
  
  <pre><code>class AIOpportunity extends Model
  {
      protected $table = 'ai_opportunity';
      protected $primaryKey = 'id_opportunity';
      public $incrementing = false;
  
      protected $fillable = [
          'id_opportunity',
          'budget',
          'created_by'
      ];
  }   
  </code></pre>
  
  <p>The problem: when trying to execute this query :</p>
  
  <pre><code>$rec = AIOpportunity::where('id_opportunity', 'abc')-&gt;first();
  </code></pre>
  
  <p>It executed the following query in the database: </p>
  
  <pre><code>select * from ai_opportunity where id_opportunity=abc
  </code></pre>
  
  <p>Which throws an error because of the type. Is there something else I can do so Eloquent understands it's a <code>varchar</code> field?</p>
  
  <p>Thanks for any help</p>