public function update(StudentRequest $request, Student $student)
 {
     $student->update($request->all());
     if ($request->ajax() || $request->wantsJson()) {
         return new JsonResponse($student);
     }
     flash()->success('aggiornato con successo!');
     return redirect('students');
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(StudentRequest $request, Student $student)
 {
     $input = $request->all();
     $student->update(['name' => $input['name'], 'telephone' => $input['telephone'], 'password' => $input['password']]);
     if ($request->ajax() || $request->wantsJson()) {
         return new JsonResponse($user);
     }
     flash()->success('aggiornato con successo!');
     return redirect('students');
 }