formatTmdbResponse($tmdb->getNowPlayingMovies(1), false, [], 12)['data']; $upcoming = $this->formatTmdbResponse($tmdb->getUpcomingMovies(1), false, [], 12)['data']; $comingsoon = $this->formatTmdbResponse($tmdb->getComingSoonMovies(1), false, [], 6)['data']; $airing = $this->formatTmdbResponse($tmdb->getAiringShows(1), false, [], 12)['data']; $hero = $this->getHomeHeroSliderData($api->getTrendingMovies(1, 7), $tmdb); // dd($hero); $popular_movies = self::formatApiResponse($api->getPopularMovies(1, 12), false)['data']; $popular_shows = self::formatApiResponse($api->getTrendingShows(1, 12), false, [], 12)['data']; $trending_movies = self::formatApiResponse($api->getTrendingMovies(1, 12), false, [], 12)['data']; $trending_shows = self::formatApiResponse($api->getTrendingShows(1, 12), false)['data']; $recent_added = $trending_movies[4]; return view('home', compact('meta', 'hero', 'popular_movies', 'popular_shows', 'trending_movies', 'trending_shows', 'nowplaying', 'upcoming', 'comingsoon', 'airing', 'recent_added')); } public function homesearch() { $meta = []; $meta['title'] = config('site.homesearch.title'); $meta['description'] = Str::limit(config('site.homesearch.description'), 150); $meta['full_description'] = config('site.homesearch.description'); $meta['keywords'] = config('site.homesearch.keywords', false); $meta['image'] = asset('images/custom-icon.png'); $content = config('site.homesearch.content'); return view('homesearch', compact('meta', 'content')); } public function search(SearchRequest $request, ApiClient $api, TmdbClient $tmdb) { $query = $request->validated()['search']; $results = $tmdb->getSearch($query); $data = $this->formatTmdbSearchResponse($results); $meta = []; $meta['title'] = config('site.search.title'); $meta['description'] = Str::replace(['{QUERY}'], $query, config('site.search.description')); $meta['keywords'] = config('site.search.keywords', false); $meta['image'] = asset('images/custom-icon.png'); $meta['page_title'] = 'Search Results for: '. $query; // sleep(2); return view('search', compact('data', 'meta')); } }