findAll(); return $this->respond($data); } public function calcular() { helper(['form']); // Access the entire POST data $post_data = $this->request->getJSON(true); //return $this->respond(var_dump($post_data)); // Instancia de presupuesto cliente $presupuestocliente = new Presupuestocliente(); $response = $presupuestocliente->calcular($post_data); $response = [ 'status' => 200, 'error' => null, 'data' => [ 'tiradas' => $response['tiradas'], 'precios' => $response['precio_u'] ] ]; return $this->respond($response); } public function delete($id = null) { $model = new ItemModel(); $find = $model->find(['id' => $id]); if (!$find) return $this->failNotFound('No Data Found'); $model->delete($id); $response = [ 'status' => 200, 'error' => null, 'messages' => [ 'success' => 'Data deleted' ] ]; return $this->respond($response); } }