title: Laravel cast model values when using Resource
body: <p>When returning a model using resource  <code>created_at</code>  and  <code>updated_at</code> <code>casting</code> is working fine,
  but when i modify the <code>toArray()</code> function the casting is not working !</p>
  <p>in my model :</p>
  <pre><code>protected $casts = [
      'created_at' =&gt; 'datetime:Y-m-d:h',
      'updated_at' =&gt; 'datetime:Y-m-d:h',
  ];
  </code></pre>
  <p>in resource :</p>
  <pre><code> public function toArray($request)
  {
      return [
          'id' =&gt; $this-&gt;id,
          'name' =&gt; $this-&gt;name,
          'value' =&gt; $this-&gt;value,
          'box' =&gt;  new BoxResource($this-&gt;box),
          'created_at' =&gt; $this-&gt;created_at,
          'updated_at' =&gt; $this-&gt;updated_at,
      ];
  }
  </code></pre>
  <p>in controller :</p>
  <pre><code>  public function index(Request $request)
  {
  
      return CurrencyResource::collection(
          Currency::where(&quot;user_id&quot;, &quot;=&quot;, $request-&gt;user()-&gt;id)
            
              -&gt;paginate($per_page)
      );
  }
  </code></pre>
  <p>How to make the casting work ?</p>