Exemplo n.º 1
0
 public function addBowler($leagueId)
 {
     $isValidToken = User::checkAuth();
     if ($isValidToken != 0) {
         $postedData = file_get_contents('php://input');
         $postedData = substr($postedData, 2, -2);
         $BowlerName = explode(':', $postedData)[1];
         $BowlerId = User::getBowlerIDByName($BowlerName);
         $BowlerId = $BowlerId[0]->id;
         $addedBowler = League::addBowlertoLeague($BowlerId, $leagueId);
         return \Response::json($addedBowler, 200);
     } else {
         return json_encode("Please enter valid Authentication Token");
     }
 }