App\Core\Tmdb\TmdbClient->getRelatedVideos():334 PHP 8.2.22

App\Core\Tmdb\TmdbClient::getRelatedVideos(): Argument #1 ($id) must be of type int, string given, called in /home/movtv/public_html/app/Http/Controllers/Home.php on line 63

/home/movtv/public_html/app/Core/Tmdb/TmdbClient.php:334

                                    
322
323
324
    public function getTrending($period 'day'): array
325
    {
326
        return $this->request('trending/' $this->getType() . '/' $period)['results'] ?? [];
327
    }
328
329
    public function getTrendingPersons($period 'day'): array
330
    {
331
        return $this->request('trending/person/' $period)['results'] ?? [];
332
    }
333
334
  public function getRelatedVideos(int $id): array
335
{
336
    $videos = [];
337
    $page 1;
338
    $perPage 20// Number of items per page
339
    $seenVideos = []; // Array to track seen video ids
340
341
    // Function to check if the video has a poster or backdrop and is not adult
342
    $isValidVideo = function($video) {
343
        return (isset($video['poster_path']) || isset($video['backdrop_path'])) && (!isset($video['adult']) || $video['adult'] === false);
344
    };
345
346
    // Loop until we have at least 20 videos or no more results are returned
347
    while (count($videos) < $perPage) {