Search by

thethunderturner / laravel-tmdb

thethunderturner

A way to access TMDB from Laravel

Package info

github.com/thethunderturner/laravel-tmdb

pkg:composer/thethunderturner/laravel-tmdb

Fund package maintenance!

thethunderturner

Statistics

Installs: 2

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2026-09-30 15:10 UTC

This package is auto-updated.

Last update: 2026-09-30 15:15:49 UTC


README

Laravel TMDB

Packagist PHP from Packagist Laravel versions GitHub Workflow Status (main) Total Downloads

Laravel integration for php-tmdb/api.

Installation

You can install the package via Composer:

composer require thethunderturner/laravel-tmdb

Set either credential in your application's .env file:

TMDB_API_KEY=your-api-key
# Or use a TMDB API read access token:
TMDB_BEARER_TOKEN=your-read-access-token

When both are set, the bearer token takes precedence. The client is created when first resolved, and requires one of these credentials.

You may publish the package configuration:

php artisan vendor:publish --tag="laravel-tmdb"

Or, you may publish each resource individually:

Publishing the Configuration File

php artisan vendor:publish --tag="laravel-tmdb-config"

Usage

The service provider is discovered automatically. Inject the upstream client wherever you need TMDB data:

use Tmdb\Client;

final class MovieController
{
    public function show(Client $tmdb, int $id): array
    {
        return $tmdb->getMoviesApi()->getMovie($id);
    }
}

You can also call app(\Tmdb\Client::class) or use the LaravelTmdb\LaravelTmdb\LaravelTmdb facade. The package registers the request listeners needed by php-tmdb/api and resolves one shared client per Laravel application. To replace its PSR-18 HTTP transport, bind Psr\Http\Client\ClientInterface before resolving the TMDB client.

The package's tests use an in memory HTTP response, so composer test:unit needs no TMDB credentials or network access. API calls and response models remain the responsibility of php-tmdb/api.

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Thank you for considering contributing to Laravel TMDB! Please review our contributing guide to get started.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

Laravel TMDB is open-sourced software licensed under the MIT license.