title: How can I make laravel casting array on the model?
body: <p>I try like this</p>
  
  <p>Data type of votes_detail in database is json</p>
  
  <p>My model like this :</p>
  
  <pre><code>&lt;?php
  class Store extends Model{  
      protected $fillable = [ ...,'votes_detail',...];
      protected $casts = [
          'votes_detail' =&gt; 'array',
      ];
  }
  </code></pre>
  
  <p>My controller like this :</p>
  
  <pre><code>$store = Store::find($id)
  $votes_detail = $store-&gt;votes_detail;
  dd($votes_detail);
  </code></pre>
  
  <p>The result of dd($votes_detail) is :</p>
  
  <blockquote>
    <p>{"1": "1", "5": "2"}</p>
  </blockquote>
  
  <p>Why the result is still json?</p>
  
  <p>The result should be an array</p>
  
  <p>Whereas I've set the array in cast model</p>
  
  <p>How can I solve this problem?</p>