json(BaixaService::index(), Response::HTTP_OK); } public function create() { $this->auth(__FUNCTION__); return response()->json(BaixaService::create(), Response::HTTP_OK); } public function store(Request $request) { $this->auth(__FUNCTION__); return response()->json(BaixaService::store($request), Response::HTTP_CREATED); } public function datatable() { return datatables() ->of(BaixaService::datatable()) ->filterColumn('cadastro_infraestrutura.nome', function ($query, $keyword) { $query->whereRaw("COALESCE(cadastro_infraestrutura.nome, cadastro_unidade.nome_fantasia) like ?", ["%{$keyword}%"]); }) ->skipTotalRecords() ->make(true); } public function list() { return response()->json(BaixaService::list(), Response::HTTP_OK); } public function historico() { return response()->json(BaixaService::historico(), Response::HTTP_OK); } }