public function update($id, array $data) { $category = $this->findById($id); $category->update($data); return $category->toArray(); }