From f1f09a0ba7e6b6177a1106fdd5105ae3bd04f5ef Mon Sep 17 00:00:00 2001 From: Louis Jeckel Date: Tue, 15 Sep 2020 10:05:23 +0200 Subject: [PATCH] Update SocialArticle.php --- app/Models/SocialArticle.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Models/SocialArticle.php b/app/Models/SocialArticle.php index ef02c6b..c7d95f1 100644 --- a/app/Models/SocialArticle.php +++ b/app/Models/SocialArticle.php @@ -33,6 +33,7 @@ class SocialArticle extends Model implements PillBoxContract 'box_title', 'box_content', 'box_link', + 'count' ]; @@ -61,8 +62,7 @@ class SocialArticle extends Model implements PillBoxContract */ public function addView(): void { - $this->count ++; - $this->save(); + $this->update(['count' => $this->count + 1]); } -- 2.39.5