]> _ Git - psq.git/commitdiff
Update SocialArticle.php
authorLouis Jeckel <louis.jeckel@outlook.cm>
Tue, 15 Sep 2020 08:05:23 +0000 (10:05 +0200)
committerLouis Jeckel <louis.jeckel@outlook.cm>
Tue, 15 Sep 2020 08:05:23 +0000 (10:05 +0200)
app/Models/SocialArticle.php

index ef02c6b2027986742e74ed5761ab1cce00da28e6..c7d95f1c04fd9b7ecb0ede17cdab305423903f94 100644 (file)
@@ -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]);
     }