FEATURE: add number of views in page
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user