コード例 #1
0
 public function show($id)
 {
     $event = Event::chosen($id);
     switch ($event->type) {
         case "photo":
             return view('Photos.photos', compact('event'));
             break;
         case "party":
             return view('ChildrensParty.create', compact('event'));
             break;
     }
 }
コード例 #2
0
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store($id, PartyRegistrationRequest $request)
 {
     $event = Event::chosen($id);
     $id = $event->parties()->create($request->all());
     return redirect()->action('ChildrenRegistrationController@show', [$id]);
 }
コード例 #3
0
 public function store($id, AddPhotoRequest $request)
 {
     $event = Event::chosen($id);
     $photo = $request->file('file');
     (new AddPhotoToEvent($event, $photo))->save();
 }