示例#1
0
 public function postRsvp()
 {
     $all = $this->request->all();
     if (isset($all['google_id'])) {
         try {
             $user = User::where('google_id', $all['google_id'])->firstOrFail();
             $msg = MessageGenerator::buildRSVPResponse($user, $all);
             return Response::json(['error' => false, 'msg' => $msg], 200);
         } catch (ModelNotFoundException $e) {
             return $this->_error('I do not know who you are. Therefore you cannot RSVP. Sorry.');
         }
     }
 }
示例#2
0
 public function getEvent($id)
 {
     try {
         $event = GameEvent::where('id', intval($id))->firstOrFail();
         $msg = MessageGenerator::buildSingleEventResponse($event);
         return Response::json(['error' => false, 'msg' => $msg]);
     } catch (ModelNotFoundException $e) {
         return $this->_error('This game could not be found.');
     }
 }