/** * Update the specified resource in storage. * * @param int $id * @return Response */ public function update($slug, $id) { $event = Event::findBySlug($slug); if ($id == 'self' && \Auth::check()) { $reg = EventRegistration::where('user_id', '=', \Auth::id())->where('event_id', '=', $event->id)->update(\Request::all()); } else { $reg = EventRegistration::find($id)->update(\Request::all()); } if ($reg) { return response('Registration updated!'); } else { abort(409, 'There was an issue updating the registration'); } }