public function same_inscTechnicalVisit($id) { $activities = Activity::where('type', '=', 'technical_visit')->orderBy('name')->get(); $id_activity = $id; $responsableNotInsc = Participant::WhereNotIn('id', function ($query) use($id_activity) { $query->select('id_participant')->from('technicalvisitparticipants')->where('id_activity', '=', $id_activity); })->orderBy('name')->get(); $responsableInsc = Participant::WhereIn('id', function ($query) use($id_activity) { $query->select('id_participant')->from('technicalvisitparticipants')->where('id_activity', '=', $id_activity); })->orderBy('name')->get(); return view('technicalVisitActivity', compact('activities', 'responsableNotInsc', 'responsableNotInsc')); }