FEATURE: add number of views in page

This commit is contained in:
Michal Kváček
2016-09-20 01:04:23 +02:00
parent 7a681fd7f7
commit 8bd30d0301
3 changed files with 45 additions and 0 deletions
+8
View File
@@ -435,4 +435,12 @@ class Content extends Model
// save history
ContentHistory::create($history);
}
public function view()
{
$this->timestamps = false;
$this->viewed ++;
$this->save();
$this->timestamps = true;
}
}