public function index()
 {
     $category = new CategoryModel();
     $resultCategory = $category->getall();
     $this->set("categorys", $resultCategory);
     $release = new ReleasesModel();
     if (Request::check(['category_id'], "POST")) {
         $release->category_id = (int) Request::get('category_id');
     }
     $result = $release->getall();
     $this->set("releases", $result);
     return View('report.index');
 }
 public function edit($id)
 {
     $category = new CategoryModel();
     $category->id = (int) $id;
     if (Request::check(['name'], "POST")) {
         $category->id = (int) $id;
         $category->update->name = Request::get('name');
         $category->update();
         $this->set("success", "Categoria atualizada com sucesso!");
     }
     $result = $category->get();
     $this->set("category", $result);
     $this->set("id", $id);
     return View("category.edit");
 }
 public function edit($id)
 {
     $release = new ReleasesModel();
     $release->id = (int) $id;
     if (Request::check(['value', 'type', 'category_id', 'description'], "POST")) {
         $release = new ReleasesModel();
         $release->id = (int) $id;
         $release->update->type = Request::get('type');
         $release->update->category_id = Request::get('category_id');
         $release->update->description = Request::get('description');
         $release->update->value = Request::get('value');
         $release->update();
         $this->set("success", "Lançamento atualizado com sucesso!");
     }
     $result = $release->get();
     $category = new CategoryModel();
     $resultCategory = $category->getAll();
     $this->set("categorys", $resultCategory);
     $this->set($this->output, $result);
     $this->set("id", $id);
     return View("releases.edit");
 }