/**
  * Update the specified resource in storage.
  *
  * @param  int $id
  * @return Response
  */
 public function update(Category $categories, CategoryRequest $request)
 {
     $attachment = ImageUploadFacade::image($request->file('attachment'));
     $categories->fill($request->all());
     if ($attachment) {
         $categories->attachment()->associate($attachment);
     }
     $categories->save();
     return redirect()->route('admin.categories.index');
 }
 /**
  * Update the specified resource in storage.
  *
  * @param Question $questions
  * @param CategoryRequest $request
  * @return Response
  */
 public function update(Question $questions, QuestionRequest $request)
 {
     $attachment = ImageUploadFacade::image($request->file('attachment'));
     $questions->fill($request->all());
     if ($attachment) {
         $questions->attachment()->associate($attachment);
     }
     $questions->save();
     return redirect()->route('admin.questions.index');
 }