private function seedGroupWithPlayers(GroupCreator $groupCreator, User $headCoach, Address $address) { $group = $groupCreator->create($headCoach, ['name' => self::GROUP_NAME, 'group_type_id' => GroupType::CHURCH, 'program_id' => Program::TEEN, 'address_id' => $address->id, 'meeting_address_id' => $address->id]); $shirtSizes = ['S', 'YS', 'M', 'L', 'YL', 'YM']; $guardian = seedGuardian([], ['latitude' => '38.301815', 'longitude' => '-85.597701']); for ($x = 0; $x <= 2; $x++) { $player = seedPlayer($guardian); $this->season->players()->attach($player->id, ['group_id' => $group->id, 'grade' => rand(6, 12), 'shirt_size' => $shirtSizes[array_rand($shirtSizes)], 'created_at' => Carbon::now()->subWeeks('10')->toDateTimeString()]); } // Seed inactive player $player = seedPlayer($guardian); $player->update(['first_name' => 'Inactive', 'first_name' => 'Joe']); $this->season->players()->attach($player->id, ['inactive' => Carbon::now()->toDateTimeString(), 'group_id' => $group->id, 'grade' => rand(6, 12), 'shirt_size' => $shirtSizes[array_rand($shirtSizes)]]); return $group; }
private function seedGroupWithPlayers(GroupCreator $groupCreator, User $headCoach, Address $address, $groupName, $guardianLat, $guardianLng) { $group = $groupCreator->create($headCoach, ['name' => $groupName, 'group_type_id' => GroupType::CHURCH, 'program_id' => Program::TEEN, 'address_id' => $address->id, 'meeting_address_id' => $address->id]); $shirtSizes = ['S', 'YS', 'M', 'L', 'YL', 'YM']; $guardian = seedGuardian([], ['latitude' => $guardianLat, 'longitude' => $guardianLng]); for ($x = 0; $x <= 2; $x++) { $player = seedPlayer($guardian); $this->season->players()->attach($player->id, ['group_id' => $group->id, 'grade' => rand(6, 12), 'shirt_size' => $shirtSizes[array_rand($shirtSizes)]]); } // Seed inactive player $player = seedPlayer($guardian); $this->season->players()->attach($player->id, ['inactive' => Carbon::now()->toDateTimeString(), 'group_id' => $group->id, 'grade' => rand(6, 12), 'shirt_size' => $shirtSizes[array_rand($shirtSizes)]]); }