/**
  * Create a new participation for somebody else.
  *
  * @return \Illuminate\Http\Response
  */
 public function createFor($id, Request $request)
 {
     $user = User::findOrFail($request->user_id);
     $event = Event::findOrFail($id);
     $data = ['activity_id' => $event->activity->id, 'user_id' => $user->id];
     if ($request->has('helping_committee_id')) {
         $helping = HelpingCommittee::findOrFail($request->helping_committee_id);
         if (!$helping->committee->isMember($user)) {
             abort(500, $user->name . " is not a member of the " . $helping->committee->name . " and thus cannot help on behalf of it.");
         }
         $data['committees_activities_id'] = $helping->id;
     }
     if (!$event->activity) {
         abort(500, "You cannot subscribe for " . $event->title . ".");
     } elseif ($event->activity->getParticipation($user, $request->has('helping_committee_id') ? HelpingCommittee::findOrFail($request->input('helping_committee_id')) : null) !== null) {
         abort(500, "You are already subscribed for " . $event->title . ".");
     } elseif ($event->activity->closed) {
         abort(500, "This activity is closed, you cannot change participation anymore.");
     }
     $request->session()->flash('flash_message', 'You added ' . $user->name . ' for ' . $event->title . '.');
     $participation = new ActivityParticipation();
     $participation->fill($data);
     $participation->save();
     return Redirect::back();
 }