/**
  * Update category.
  *
  * @param EditCategoryRequest $request
  * @return \Illuminate\Contracts\Routing\ResponseFactory|\Symfony\Component\HttpFoundation\Response
  */
 public function editCategory(EditCategoryRequest $request)
 {
     HelpCenterCategory::where('id', $request->get('category_id'))->update(['name' => $request->get('new_name')]);
     $response = new AjaxResponse();
     $response->setSuccessMessage(trans('category_updated'));
     $response->addExtraFields(['categories' => HelpCenterManagerHelper::getHelpCenterCategories()]);
     return response($response->get());
 }