getEpisodeByPreviewId($params[0]); if (! $episode instanceof Episode) { throw PageNotFoundException::forPageNotFound(); } $this->episode = $episode; if ($episode->publication_status === 'published') { // redirect to episode page return redirect()->route('episode', [$episode->podcast->handle, $episode->slug]); } unset($params[0]); return $this->{$method}(...$params); } public function index(): RedirectResponse | string { helper('form'); return view('episode/preview-comments', [ 'podcast' => $this->episode->podcast, 'episode' => $this->episode, ]); } public function activity(): RedirectResponse | string { helper('form'); return view('episode/preview-activity', [ 'podcast' => $this->episode->podcast, 'episode' => $this->episode, ]); } }