コード例 #1
0
ファイル: RsvpController.php プロジェクト: admacdon13/wedding
 public function update($id, RsvpRequest $request)
 {
     $rsvp = Rsvp::findOrFail($id);
     $rsvp->update($request->all());
     return redirect('pages.thanks');
 }
コード例 #2
0
 /**
  * Delete a row from the rsvp table corresponding to the event id and the user id.
  *
  * @param int $id
  * @return \Illuminate\Http\Response
  */
 public function unattendEvent($id)
 {
     //deletes the row corresponding to the current user and the eventid $id from
     //the rsvp table
     Rsvp::where(['userid' => Auth::user()->id, 'eventid' => $id])->delete();
     //redirects to the events page.
     return redirect('/events');
 }
コード例 #3
0
 public function guestlist()
 {
     $rsvps = Rsvp::all();
     return view('pages.guestlist', compact('rsvps'));
 }
コード例 #4
0
 /**
  * Show the page listing all the tickets in printable format for an event.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function printAttendees($id)
 {
     $ev = Event::where('id', $id)->firstorfail();
     $atns = Rsvp::join('users', 'users.id', '=', 'rsvp.userid')->select('*')->where('rsvp.eventid', '=', $id)->get();
     return view('admin/printall', ['atns' => $atns, 'ev' => $ev]);
 }