private function findFreelancers() { $freelancers = Freelancer::where('category', Auth::user()->projects()->first()->category)->orderBy('updated_at', 'desc')->get(); foreach ($freelancers as $freelancer) { if (Decision::where('project_id', Auth::user()->projects()->first()->id)->where('freelancer_id', $freelancer->id)->where('decision', 0)->exists() || Decision::where('project_id', Auth::user()->projects()->first()->id)->where('freelancer_id', $freelancer->id)->where('user_id', Auth::id())->exists() || Match::where('project_id', Auth::user()->projects()->first()->id)->where('freelancer_id', $freelancer->id)->exists()) { continue; } return $freelancer; } return null; }