Пример #1
0
 public function update(UpdateCategoryRequest $request, $id)
 {
     $category = Category::findOrFail($id);
     $category->update($request->all());
     session()->flash('flash_message', message('user_successfully_updated_category'));
     return redirect('/categories/manage');
 }
Пример #2
0
 /**
  * Update the specified resource in storage.
  *
  * @param  UpdateCategoryRequest $request
  * @param  int $id
  * @return RedirectResponse
  */
 public function update(UpdateCategoryRequest $request, $id) : RedirectResponse
 {
     $category = Category::find($id);
     $params = $request->all();
     $params['slug'] = strtolower($params['slug']);
     $category->update($params);
     return Redirect::route('back.category.index')->with('message', ucfirst(trans('back/category.success_updated')));
 }
Пример #3
0
 /**
  * Update the specified resource in storage.
  *
  * @param  Request  $request
  * @param  int  $id
  * @return Response
  */
 public function update(UpdateCategoryRequest $request, $id)
 {
     $data = $request->only(['name']);
     Category::findOrFail($id)->update($data);
     return redirect()->route('admin.' . self::URI . '.index');
 }
Пример #4
0
 /**
  * Update the specified Category in storage.
  *
  * @param  int              $id
  * @param UpdateCategoryRequest $request
  *
  * @return Response
  */
 public function update($id, UpdateCategoryRequest $request)
 {
     $category = $this->categoryRepository->find($id);
     if (empty($category)) {
         Flash::error('Category not found');
         return redirect(route('categories.index'));
     }
     $input = $request->all();
     if ($request->file('image')) {
         $image = $this->uploadImage($request->file('image'), '/categories_photo/');
         $input['image'] = $image['resize_url'][0];
     }
     $this->categoryRepository->updateRich($input, $id);
     Flash::success('Category updated successfully.');
     return redirect(route('categories.index'));
 }
Пример #5
0
 /**
  * Update the specified Category in storage.
  *
  * @param  int              $id
  * @param UpdateCategoryRequest $request
  *
  * @return Response
  */
 public function update($id, UpdateCategoryRequest $request)
 {
     $category = $this->categoryRepository->find($id);
     if (empty($category)) {
         Flash::error('Category not found');
         return redirect(route('categories.index'));
     }
     $category = $this->categoryRepository->updateRich($request->all(), $id);
     Flash::success('Category updated successfully.');
     return redirect(route('categories.index'));
 }
Пример #6
0
 /**
  * Update the specified category in storage.
  * @param UpdateCategoryRequest|Request $request
  *
  * @param  int  $id
  */
 public function update($id, UpdateCategoryRequest $request)
 {
     $category = Category::findOrFail($id);
     $category->update($request->all());
     return redirect()->route('admin.category.index');
 }