/** * @return mixed */ public function postPlayers(PlayerRegistrationRequest $request, GroupRegistration $registration) { // map the POSTed data to the season data required foreach ($request->get('player') as $playerId => $playerData) { if (isset($playerData['register']) && $playerData['register'] == 1) { $registration->addPlayer($playerId, $playerData['grade'], $playerData['shirtSize']); } } // if they followed a link to get to the registration // auto-associate them with this group $familiarGroup = Session::getGroupToRegisterWith(); if ($familiarGroup !== null) { $registration->addGroup($familiarGroup); } // save in session so we can show this info on // the summary page Session::setSeasonalGroupRegistration($registration); // sometimes parents can override the program selection if ($registration->requiresProgramSelection()) { return redirect('/register/program'); } return redirect('/register/summary'); }
/** * Seed 2 players for each Group. * * @param Group $group */ public function addGroup(Group $group) { parent::addGroup($group); $this->addPlayer(self::TEST_PLAYER_ID_1, $group->program->min_grade, 'SM'); $this->addPlayer(self::TEST_PLAYER_ID_2, $group->program->max_grade, 'M'); }