job_name = $name; $this->complete = false; $this->system_time = Carbon::now(); } public function SetStartStatus() { $this->jobStatus = new JobStatus; $this->jobStatus->job_name = $this->job_name; $this->jobStatus->complete = $this->complete; $this->jobStatus->system_time = $this->system_time; } public function SetStopStatus() { $this->jobStatus::update([ 'complete' => true, ]); } public function CleeanJobStatusTable() { DB::table('job_statuses')->where('system_time', '<', Carbon::now()->subMonths(3))->delete(); } }