public function update(CategoryRequest $request, $id)
    {
        $category = $this->repository->update($request, $id);

        if ($category) {
            $message = "Successfully updated $this->resource";

            return redirect()->route($this->routes['index'])->withSuccess($message);
        } else {
            $message = "There was an issue updating this $this->resource. Please try again.";

            return redirect()->route($this->routes['edit'], $id)->withErrors($message);
        }
    }
public function update(CategoryRequest $request, $id)
    {
        $category = $this->repository->update($request, $id);

        if ($category) {
            $message = "Successfully updated $this->resource";

            return redirect()->route($this->routes['index'])->withSuccess($message);
        } else {
            $message = "There was an issue updating this $this->resource. Please try again.";

            return redirect()->route($this->routes['edit'], $id)->withErrors($message);
        }
    }
public function update ( CategoryRequest $ request , $ id ) { $ category = $ this -> repository -> update ( $ request , $ id ) ; if ( $ category ) { $ message = "Successfully updated $this->resource" ; return redirect ( ) -> route ( $ this -> routes [ 'index' ] ) -> withSuccess ( $ message ) ; } else { $ message = "There was an issue updating this $this->resource. Please try again." ; return redirect ( ) -> route ( $ this -> routes [ 'edit' ] , $ id ) -> withErrors ( $ message ) ; } }
Processes updating the specified category.

@param CategoryRequest $request
@param int|string      $id

@return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse
Processes updating the specified category .