/**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(Requests\CategoryRequest $request, $id)
 {
     //
     $input = $request->all();
     $this->categoryModel->find($id)->update($input);
     return redirect()->route('listcategory');
 }
 public function store(Requests\CategoryRequest $request)
 {
     /*Outra maneira de se fazer
      * $input = $request->all();
      * $category = $this->categoria->fill($input);
      * $categoria->save();
      */
     $this->categoria->create($request->all());
     return redirect()->action('AdminCategoriesController@index');
 }
 /**
  * processar dados do post e salvar em model
  */
 public function store(Requests\CategoryRequest $request)
 {
     $input = $request->all();
     $category = $this->categories->fill($input);
     //dados do request passados para o model
     $category->save();
     //persiste no banco
     flash('Categoria criada com sucesso. -' . $category->name);
     //flash message teste
     return redirect()->route('admin.categories.index');
 }
 public function update(Requests\CategoryRequest $request, $id)
 {
     $this->categoryModel->find($id)->update($request->all());
     return redirect()->route('categories');
 }
 public function update(Requests\CategoryRequest $request, \CodeCommerce\Category $category)
 {
     $category->update($request->all());
     return redirect()->route('categories.index');
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(CategoryRequest $request, $id)
 {
     //
     $this->category->find($id)->update($request->all());
     return redirect()->route('admin.categories.index');
 }
Пример #7
0
 public function update(Requests\CategoryRequest $request, $id)
 {
     $input = $request->all();
     $category = $this->categoryModel->find($id)->update($input);
     return redirect()->route('categories.index');
 }
 /**
  * Insert Category
  *
  * @param CategoryRequest $request
  */
 public function insert(CategoryRequest $request)
 {
     $data = $request->all();
     $this->categoriesRepository->create($data);
 }
 public function update(Requests\CategoryRequest $request, $id)
 {
     $this->model->find($id)->update($request->all());
     return redirect('admin/categories');
 }