title: Laravel : $casts in laravel model not working
body: <p>i have column <code>id_a(varchar , primary key)</code> with values are 1 - 10. I want to cast that id_a column to integer, so if i execute query <code>\App\Model\Main::max('id_a');</code> it returns value 10 same as if i do <code>SELECT MAX(CAST(id_a as integer)) FROM mains</code>. I added this code to my model but not working (The \App\Model\Main::max('id_a') still return value 9): </p>
  
  <pre><code>protected $casts = [
       'id_a' =&gt; 'integer',
   ];
  </code></pre>
  
  <p>and this is the full code of my model : </p>
  
  <pre><code>protected $table = 'tb_main';
  protected $primaryKey = 'id_a';
  public $incrementing = false;
  
  protected $guarded = ['id_a'];
  
  protected $casts = [
       'id_acara' =&gt; 'integer',
   ];
  </code></pre>