public function getLatestSuccessful($project_id) { return $this->model->where('project_id', $project_id)->where('status', Deployment::COMPLETED)->whereNotNull('started_at')->orderBy('started_at', 'DESC')->first(); }