Browse Source

Update LikeController, store status_profile_id and is_comment attributes

Daniel Supernault 4 năm trước cách đây
mục cha
commit
799a4cba12
1 tập tin đã thay đổi với 9 bổ sung0 xóa
  1. 9 0
      app/Http/Controllers/LikeController.php

+ 9 - 0
app/Http/Controllers/LikeController.php

@@ -43,6 +43,15 @@ class LikeController extends Controller
             if($like->wasRecentlyCreated == true) {
                 $count++;
                 $status->likes_count = $count;
+                $like->status_profile_id = $status->profile_id;
+                $like->is_comment = in_array($status->type, [
+                    'photo',
+                    'photo:album',
+                    'video',
+                    'video:album',
+                    'photo:video:album'
+                    ]) == false;
+                $like->save();
                 $status->save();
                 LikePipeline::dispatch($like);
             }