/**
  * Update the specified resource in storage.
  *
  * @param StoreStudentRequest|Request $request
  * @param  int $id
  * @return \Illuminate\Http\Response
  */
 public function update(StoreStudentRequest $request, $id)
 {
     if (Gate::denies('edit-student')) {
         abort(403);
     }
     $student = User::findOrFail($id);
     $student->update($request->all());
     return $student;
 }
Пример #2
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(StoreStudentRequest $request)
 {
     return $this->university->students()->create($request->all());
 }