getTrendingMovies(1, 20), false, [], 20)['data']; $popular = $this->formatTmdbResponse($tmdb->getPopularMovies(1), false, [], 20)['data']; $trending_shows = self::formatApiResponse($api->getTrendingShows(1, 20), false, [], 20)['data']; $popular_shows = $this->formatTmdbResponse($tmdb->getPopularShows(1), false, [], 20)['data']; return [ 'movies' => [ 'col1' => array_map(function($item) { return [ 'title' => $item['title'], 'slug' => $item['slug'], 'id' => $item['id'], ]; }, $trending), 'col2' => array_map(function($item) { return [ 'title' => $item['title'], 'slug' => $item['slug'], 'id' => $item['id'], ]; }, $popular) ], 'shows' => [ 'col1' => array_map(function($item) { return [ 'title' => $item['title'], 'slug' => $item['slug'], 'id' => $item['id'], ]; }, $trending_shows), 'col2' => array_map(function($item) { return [ 'title' => $item['title'], 'slug' => $item['slug'], 'id' => $item['id'], ]; }, $popular_shows) ] ]; }); } }