FIX: fix saving 'viewed' column with updated_at

This commit is contained in:
Michal Kváček
2017-02-22 01:46:13 +01:00
parent f3b1951d25
commit c64f825886
2 changed files with 6 additions and 6 deletions
+6
View File
@@ -163,4 +163,10 @@ class Content extends Model
return parent::save($options); return parent::save($options);
} }
public function view()
{
$this->timestamps = false;
$this->increment('viewed');
}
} }
@@ -86,10 +86,4 @@ trait Content
return count($allFiles); return count($allFiles);
} }
public function view()
{
$this->viewed++;
$this->save(['timestamps' => false]);
}
} }