wzq il y a 5 ans
Parent
commit
5bd5cb5708
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      app/Transformers/Post/CommentTransformer.php

+ 1 - 1
app/Transformers/Post/CommentTransformer.php

@@ -25,7 +25,7 @@ class CommentTransformer extends TransformerAbstract
         if($replyData){
             $reply = json_decode($replyData);
             foreach($reply as &$item){
-                $item['created_at'] = Carbon::parse($item->created_at)->diffForHumans();
+                $item->created_at = Carbon::parse($item->created_at)->diffForHumans();
             }
         }else{
             $replies = PostComment::where('parent_id', $postComment['id'])->orderBy('id', 'desc')->limit(2)->get();