public function update($id, StudentRequest $request)
 {
     $student = Student::findOrFail($id);
     $input = $request->all();
     $student->update($input);
     session()->flash('flash_message', 'You have been updated 1 student!');
     return redirect()->route('settings.student');
 }
 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');
 }
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(StudentRequest $request)
 {
     //
     // $student= new student;
     // $student->name=Request::get('name');
     // $student->major=Request::get('major');
     // $student->save();
     student::create($request->all());
     return redirect('students');
     //return $student;
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id, StudentRequest $request)
 {
     $data = $request->all();
     $student = StudentQuery::create()->findPK($id);
     $student->fromArray($data);
     $student->save();
     flash()->success("UPDATED");
     session(['attribute' => \Lang::get('general.STUDENT')]);
     return redirect($this->main_page);
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id, StudentRequest $request)
 {
     $student = Student::FindOrFail($id);
     $student->update($request->all());
     return redirect('student');
 }
 public function update(StudentRequest $request, Student $student)
 {
     $user = $student->user()->first();
     $student->update($request->all());
     $user->update($request->all());
 }