json($vats); } public function addVat(): ResponseInterface { \Vat::create([]); return $this->json(['success' => true]); } public function saveVat(int $vatID): ResponseInterface { $vatrate = $this->request->getPost('vatrate'); \Vat::whereId($vatID)->update(['vatrate' => $vatrate]); return $this->json(['success' => true]); } public function removeVat(int $vatID): ResponseInterface { $removeVat = new \RemoveVat($vatID); $allowRemove = $removeVat->getRemoveAllowed(); if ($allowRemove === false) { return $this->json(['result' => false]); } \Vat::whereId($vatID)->delete(); return $this->json(['result' => true]); } }