From: Louis Jeckel Date: Tue, 15 Sep 2020 08:05:23 +0000 (+0200) Subject: Update SocialArticle.php X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=f1f09a0ba7e6b6177a1106fdd5105ae3bd04f5ef;p=psq.git Update SocialArticle.php --- 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]); }