FIX: fix saving 'viewed' column with updated_at
This commit is contained in:
@@ -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]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user