auth(__FUNCTION__); return response()->json(OrigemProgramaticaService::create(), Response::HTTP_OK); } public function store(Request $request) { $this->auth(__FUNCTION__); return response()->json(OrigemProgramaticaService::store($request), Response::HTTP_CREATED); } public function edit($id) { $this->auth(__FUNCTION__); return response()->json(OrigemProgramaticaService::edit($id), Response::HTTP_OK); } public function update(Request $request, $id) { $this->auth(__FUNCTION__); return response()->json(OrigemProgramaticaService::update($request, $id), Response::HTTP_OK); } public function destroy($id) { $this->auth(__FUNCTION__); return response()->json(OrigemProgramaticaService::destroy($id), Response::HTTP_NO_CONTENT); } public function datatable() { return datatables() ->of(OrigemProgramaticaService::datatable()) ->filterColumn('cadastro_origem_programatica.ativo', function ($query, $keyword) { $query->whereRaw("CASE WHEN cadastro_origem_programatica.ativo THEN 'Sim' ELSE 'Não' END LIKE ?", ["%{$keyword}%"]); }) ->make(true); } public function autocomplete() { return datatables() ->of(OrigemProgramaticaService::autocomplete()) ->make(true); } }