protected function isProjectNew($project) { $proceedingTitle = $this->getProceedingTitle($project); $proceeding = Project::where('city_district_id', '=', $this->city_district_id)->whereHas('proceedings', function ($q) use($proceedingTitle) { $q->where('title', '=', $proceedingTitle); })->get()->count(); return $proceeding ? false : true; }
protected function isProjectNew($project) { $proceedingPostDate = $this->getDates($project)[0]; $proceedingDescription = $this->getProceedingDescription($project); $proceeding = Project::where('city_district_id', '=', $this->city_district_id)->whereHas('proceedings', function ($q) use($proceedingPostDate, $proceedingDescription) { $q->where('posted_at', '=', $proceedingPostDate)->where('description', '=', $proceedingDescription); })->get()->count(); return $proceeding ? false : true; }
protected function isProjectNew($project) { $proceedingPostDate = $this->getProceedingPostDate($project); $proceedingFileReference = $this->getProceedingFileReference($project); $proceeding = Project::where('city_district_id', '=', $this->city_district_id)->whereHas('proceedings', function ($q) use($proceedingFileReference, $proceedingPostDate) { $q->where('posted_at', '=', $proceedingPostDate)->where('file_reference', '=', $proceedingFileReference); })->get()->count(); return $proceeding ? false : true; }
public function store($data) { return Project::create($data); }