findAll(); // check if there's only one podcast to redirect user to it if (count($all_podcasts) == 1) { return redirect()->to( base_url(route_to('podcast_view', $all_podcasts[0]->name)) ); } // default behavior: list all podcasts on home page $data = ['podcasts' => $all_podcasts]; return view('home', $data); } }