REFACTORING: move content update and create logic into separate interactions
This commit is contained in:
@@ -3,6 +3,8 @@ namespace App\Models\Content\ModelTraits;
|
||||
|
||||
use App\CMS\Enumerations\ContentStatuses;
|
||||
use App\Http\Requests\Request;
|
||||
use App\Models\Content\ContentHasFile;
|
||||
use App\Models\Content\ContentHistory;
|
||||
use App\Models\FileManager\Directory;
|
||||
use App\Models\FileManager\File;
|
||||
use Carbon\Carbon;
|
||||
@@ -352,9 +354,7 @@ trait Content {
|
||||
|
||||
public function view()
|
||||
{
|
||||
$this->timestamps = false;
|
||||
$this->viewed++;
|
||||
$this->save();
|
||||
$this->timestamps = true;
|
||||
$this->save(['timestamps' => false]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user