Bladeren bron

Update LikeController, store status_profile_id and is_comment attributes

Daniel Supernault 4 jaren geleden
bovenliggende
commit
799a4cba12
1 gewijzigde bestanden met toevoegingen van 9 en 0 verwijderingen
  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) {
             if($like->wasRecentlyCreated == true) {
                 $count++;
                 $count++;
                 $status->likes_count = $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();
                 $status->save();
                 LikePipeline::dispatch($like);
                 LikePipeline::dispatch($like);
             }
             }