title: How can we use carbon diffforhumans with array
body: <p>I am using my user controller to return his liked documents and it is returning in array rather than object so i want to use carbon diffforhumans with my date field how can we use it .Here is my controllers code</p>
  
  <pre><code>public function myfavourites()
  {
      // echo "This is myfavourites";
      $user_id = Auth::user()-&gt;id;
      // $liked_post =  Like::all()-&gt;where('user_id', $user_id);
  
      return view('user.myfavourites')-&gt;with('likes', Like::where('user_id', $user_id)-&gt;orderBy('created_at', 'DESC')-&gt;paginate(12));
  }
  </code></pre>
  
  <p>and here is my blade code</p>
  
  <pre><code>&lt;h6 class="text-muted"&gt;Published &lt;b&gt;{{ $like-&gt;document['created_at']-&gt;diffForHumans() }}&lt;/b&gt;&lt;/h6&gt;
  </code></pre>
  
  <p>here h6 is in foreach loop where i am looping throw the all liked documents by the user.
  i have relation with my like model to with my document model
  here is my relationship function </p>
  
  <pre><code>public function document()
      {
          return $this-&gt;belongsTo('App\Document');
      }
  </code></pre>
  
  <p>whats the solution of this problem either i have to return likes in object form if yes then how?</p>