/**
  * Update the specified Brand in storage.
  * PUT/PATCH /brands/{id}
  *
  * @param  int              $id
  * @param Request $request
  *
  * @return Response
  */
 public function update($id, Request $request)
 {
     $input = $request->all();
     /** @var Brand $brand */
     $brand = $this->brandRepository->apiFindOrFail($id);
     $result = $this->brandRepository->updateRich($input, $id);
     $brand = $brand->fresh();
     return $this->sendResponse($brand->toArray(), "Brand updated successfully");
 }
 /**
  * Update the specified Brand in storage.
  *
  * @param  int              $id
  * @param UpdateBrandRequest $request
  *
  * @return Response
  */
 public function update($id, UpdateBrandRequest $request)
 {
     $brand = $this->brandRepository->find($id);
     if (empty($brand)) {
         Flash::error('Brand not found');
         return redirect(route('brands.index'));
     }
     $this->brandRepository->updateRich($request->all(), $id);
     Flash::success('Brand updated successfully.');
     return redirect(route('brands.index'));
 }