public function show($year, $month, $day) { $date = $this->createDate($year, $month, $day); $photos = new Collection(); $photo = new Photo($date); if ($photo->exists() === false) { return $this->redirectToNewestPhoto(); } $photos->put('prev', $photo->findPrevPhoto()); $photos->put('curr', $photo); $photos->put('next', $photo->findNextPhoto()); return response()->json($photos); }