These films come from The Movie Database (TMDB). Here is the real PHP I wrote to fetch and filter them.
public function __construct() { $this->apiUrl = config('tmdb.api_url'); $this->apiToken = config('tmdb.api_token'); }
private function fetchMovies($page = 1, $excludedWords = []) { $response = Http::withToken($this->apiToken) ->get("{$this->apiUrl}/discover/movie", [ 'language' => 'en-US', 'page' => $page, 'with_genres' => '10751' ]); $movies = $response->json(); // Filter out movies containing any of the excluded words $filtered = array_filter($movies['results'] ?? [], function ($movie) use ($excludedWords) { $title = strtolower($movie['title'] ?? $movie['name'] ?? ''); foreach ($excludedWords as $word) { if (strpos($title, strtolower($word)) !== false) { return false; } } return true; }); // Pagination logic $moviesPerPage = 8; $totalMovies = count($filtered); $startIndex = ($page - 1) * $moviesPerPage; return array_slice($filtered, $startIndex, $moviesPerPage); }
private function fetchChristianMovies($page = 1) { $response = Http::withToken($this->apiToken) ->get("{$this->apiUrl}/list/8938", [ 'language' => 'en-US', 'page' => $page ]); return $response->json(); }
private function fetchRecommendations($id) { $response = Http::withToken($this->apiToken) ->get("{$this->apiUrl}/movie/{$id}/recommendations"); return $response->json(); }
Rating: 7.181
The wildly funny and touching story of a lonely Hawaiian girl and the fugitive alien who helps to me...
Rating: 7.594
While working underground to fix a water main, Brooklyn plumbers—and brothers—Mario and Luigi are tr...
Rating: 8.124
After hundreds of years doing what he was built for, WALL•E— a robot designed to clean up the earth—...
Rating: 6.967
A live-action adaptation of Disney's version of the classic tale of a cursed prince and a beautiful...
Rating: 7.051
Lightning McQueen, a hotshot rookie race car driven to succeed, discovers that life is about the jou...
Rating: 7.96
Carl Fredricksen spent his entire life dreaming of exploring the globe and experiencing life to its...
Rating: 7.26
Determined to prove he's the world's greatest supervillain, Gru hatches an audacious plan to steal t...
Rating: 7.729
Bob Parr has given up his superhero days to log in time as an insurance adjuster and raise his three...