/**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update($slug, BardTrainerFormRequest $request)
 {
     if (isset($input['image'])) {
         $Image = $input['image'];
         //dd($Image);
         $imagePath = $this->imageUpload($Image);
         //call public function imageUpload for small img
     } else {
         $imagePath = BardTrainer::where('slug', '=', $slug)->pluck('filePath');
         //dd($imagePath);
     }
     $bardtrainer = BardTrainer::whereSlug($slug)->firstOrFail();
     $bardtrainer->name = $request->get('name');
     $bardtrainer->email = $request->get('email');
     $bardtrainer->country = $request->get('country');
     $bardtrainer->skill_set = $request->get('skill_set');
     $bardtrainer->gender = $request->get('gender');
     $bardtrainer->educational_qualification = $request->get('educational_qualification');
     $bardtrainer->previous_experience = $request->get('previous_experience');
     $bardtrainer->date_of_birth = $request->get('date_of_birth');
     $bardtrainer->cell_number = $request->get('cell_number');
     $trainer->filePath = $imagePath;
     if ($request->get('status') != null) {
         $bardtrainer->status = 0;
     } else {
         $bardtrainer->status = 1;
     }
     $bardtrainer->save();
     return redirect(action('BardTrainersController@edit', $bardtrainer->slug))->with('status', 'The BARD trainer status has been updated!');
 }