public function showByDate($year, $month) { $roster = Roster::withYear($year)->withMonth($month)->first(); if ($roster == null) { $roster = Roster::create(['year' => $year, 'month' => $month]); } return $this->respond($roster); }
public function showByDate($year, $month) { $events = Roster::withYear($year)->withMonth($month)->first()->events(); return $this->respond($events); }