public function setupAsHeadCoach() { $this->headCoach = User::where('email', DatabaseSeeder::HEAD_COACH_EMAIL)->first(); $this->group = Group::where('name', DatabaseSeeder::GROUP_NAME)->first(); $this->season = Season::orderBy('id', 'DESC')->first(); $this->actingAs($this->headCoach)->withSession([SessionManager::GROUP => $this->group->toArray(), SessionManager::SEASON => $this->season->toArray()]); }
public function setSeason(Season $season) { $this->season = $season; $this->set(self::SEASON, $season->toArray()); }
public function setupAsGuardian() { $this->guardian = User::where('email', DatabaseSeeder::GUARDIAN_EMAIL)->first(); $this->season = Season::orderBy('id', 'DESC')->first(); $this->actingAs($this->guardian)->withSession([SessionManager::SEASON => $this->season->toArray()]); }
public function setupAsDirector() { $this->director = User::where('email', DatabaseSeeder::DIRECTOR_EMAIL)->first(); $this->season = Season::orderBy('id', 'DESC')->first(); $this->actingAs($this->director)->withSession([SessionManager::SEASON => $this->season->toArray()]); }