errorPresupuestoModel = model(ErrorPresupuesto::class); } public function index() { $viewData = [ 'currentModule' => static::$controllerSlug, ]; $viewData = array_merge($this->viewData, $viewData); // merge any possible values from the parent controller class return view(static::$viewPath . $this->indexRoute, $viewData); } public function viewForm(int $error_presupuesto_id) { $viewData = [ 'currentModule' => static::$controllerSlug, 'errorPresupuesto' => $this->errorPresupuestoModel->find($error_presupuesto_id), ]; return view(static::$viewPath . $this->indexRoute, $viewData); } public function store(){ $data = []; $variableCreated = $this->errorPresupuestoModel->store($data); return $this->response->setJSON($variableCreated); } public function get(int $error_presupuesto_id){ $data = $this->errorPresupuestoModel->find($error_presupuesto_id); return $this->response->setJSON($data); } public function updateErrorPresupuesto(int $error_presupuesto_id){ } public function datatable(){ $query = $this->errorPresupuestoModel->getQueryDatatable(); return DataTable::of($query) ->add("action",fn($q) => $q->id) ->toJson(true); } }