of(FormulaExameService::datatable()) ->filterColumn('fatores', function ($query, $keyword) { $query->whereIn('exame_laboratorial_formula_exame.id', function ($subquery) use ($keyword) { $subquery->select('formula_exame_id') ->from('exame_laboratorial_formula_exame_fator') ->where('fator', 'LIKE', "%{$keyword}%"); }); }) ->skipTotalRecords() ->toJson(); } public function create() { $this->auth(__FUNCTION__); return response()->json(FormulaExameService::create(), Response::HTTP_OK); } public function store(Request $request) { $this->auth(__FUNCTION__); return response()->json(FormulaExameService::store($request), Response::HTTP_CREATED); } public function edit($id) { $this->auth(__FUNCTION__); return response()->json(FormulaExameService::edit($id), Response::HTTP_OK); } public function update(Request $request, $id) { $this->auth(__FUNCTION__); return response()->json(FormulaExameService::update($request, $id), Response::HTTP_NO_CONTENT); } public function destroy($id) { $this->auth(__FUNCTION__); return response()->json(FormulaExameService::destroy($id), Response::HTTP_NO_CONTENT); } }