PHPackages                             dariusiii/tmdb-laravel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. dariusiii/tmdb-laravel

ActiveLibrary[API Development](/categories/api)

dariusiii/tmdb-laravel
======================

Laravel Package for TMDB ( The Movie Database ) API. Provides easy access to the wtfzdotnet/php-tmdb-api library.

13.0(1mo ago)1821.1k7MITPHPPHP &gt;=8.3

Since Sep 13Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/DariusIII/tmdb-laravel)[ Packagist](https://packagist.org/packages/dariusiii/tmdb-laravel)[ RSS](/packages/dariusiii-tmdb-laravel/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (20)Versions (43)Used By (0)

Laravel Package for TMDB API Wrapper
====================================

[](#laravel-package-for-tmdb-api-wrapper)

[![License](https://camo.githubusercontent.com/1018b651d50d3b2f658940b833eee5c27f7c73c66fca20b7a148783680fa0d2d/68747470733a2f2f706f7365722e707567782e6f72672f6461726975736969692f746d64622d6c61726176656c2f6c6963656e73652e706e67)](https://packagist.org/packages/dariusiii/tmdb-laravel)[![Build Status](https://camo.githubusercontent.com/49afefe9529ac99ae3bccabb876070918dee2b078d42b376cf2a15e6677783cb/68747470733a2f2f7472617669732d63692e6f72672f6461726975736969692f746d64622d6c61726176656c2e737667)](https://travis-ci.org/dariusiii/tmdb-laravel)[![Code Coverage](https://camo.githubusercontent.com/7237527eaecde62678e8d85a4bb62e73d9821de7674830b19c588bf19f0df72f/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6461726975736969692f746d64622d6c61726176656c2f6261646765732f636f7665726167652e706e67)](https://scrutinizer-ci.com/g/dariusiii/tmdb-laravel/)

A Laravel package that provides easy access to the [php-tmdb/api](https://github.com/php-tmdb/api) TMDB (The Movie Database) API wrapper. This package comes with a service provider that configures the `Tmdb\Client` and registers it to the IoC container. Supports Laravel 8 through 13.

[![Latest Stable Version](https://camo.githubusercontent.com/f905b57139b87354dd3104c2e017f82126f3a50fa2a115b9cbaf6bc06b7b1556/68747470733a2f2f706f7365722e707567782e6f72672f6461726975736969692f746d64622d6c61726176656c2f762f737461626c652e737667)](https://packagist.org/packages/dariusiii/tmdb-laravel)[![Latest Unstable Version](https://camo.githubusercontent.com/4ddb84fce6aa6fdc86b41f71958ab4a20f57a92cd017ff8eebee02d52c84c3a1/68747470733a2f2f706f7365722e707567782e6f72672f6461726975736969692f746d64622d6c61726176656c2f762f756e737461626c652e737667)](https://packagist.org/packages/dariusiii/tmdb-laravel)[![Total Downloads](https://camo.githubusercontent.com/790c2e1b8cee125b0741043dc21a72014f2d90ad5c674be3612e4a05ee018129/68747470733a2f2f706f7365722e707567782e6f72672f6461726975736969692f746d64622d6c61726176656c2f646f776e6c6f6164732e737667)](https://packagist.org/packages/dariusiii/tmdb-laravel)

Installation
------------

[](#installation)

Install Composer

```
$ curl -sS https://getcomposer.org/installer | php
$ sudo mv composer.phar /usr/local/bin/composer

```

Add the following to your require block in `composer.json` config

```
"dariusiii/tmdb-laravel": "^2.0"

```

or just run the following command in your project:

```
composer require dariusiii/tmdb-laravel

```

Configuration
-------------

[](#configuration)

Laravel will auto-discover the package on supported versions. If you prefer to register it manually, add the service provider to `config/app.php`:

```
'providers' => array(
    // other service providers

    'Tmdb\Laravel\TmdbServiceProvider',
)
```

Then publish the configuration file:

```
php artisan vendor:publish --provider="Tmdb\Laravel\TmdbServiceProvider"

```

Next you can modify the generated configuration file `tmdb.php` accordingly.

That's all! Fire away!

Usage
-----

[](#usage)

We can choose to either use the `Tmdb` Facade, or to use dependency injection.

Development
-----------

[](#development)

Run the package quality checks locally with Composer scripts:

```
composer test
composer phpstan
```

### Facade example

[](#facade-example)

The example below shows how you can use the `Tmdb` facade. If you don't want to keep adding the `use Tmdb\Laravel\Facades\Tmdb;` statement in your files, then you can also add the facade as an alias in `config/app.php` file.

```
use Tmdb\Laravel\Facades\Tmdb;

class MoviesController {

    function show($id)
    {
        // returns information of a movie
        return Tmdb::getMoviesApi()->getMovie($id);
    }
}
```

### Dependency injection example

[](#dependency-injection-example)

```
use Tmdb\Repository\MovieRepository;

class MoviesController {

    private $movies;

    function __construct(MovieRepository $movies)
    {
        $this->movies = $movies;
    }

    function index()
    {
        // returns information of a movie
        return $this->movies->getPopular();
    }
}
```

### Listening to events

[](#listening-to-events)

We can easily listen to events that are dispatched using the Laravel event dispatcher that we're familiar with. The following example listens to any request that is made and logs a message.

```
use Event;
use Illuminate\Support\Facades\Log;
use Tmdb\Event\RequestEvent;

Event::listen(RequestEvent::class, function (RequestEvent $event) {
    Log::info("A request was made to TMDB");
    // do stuff with $event
});
```

You can also register the same listener in your application's `EventServiceProvider`.

### Image helper

[](#image-helper)

You can easily use the `ImageHelper` by using dependency injection. The following example shows how to show the poster image of the 20 most popular movies.

```
namespace App\Http\Controllers;

use Tmdb\Helper\ImageHelper;
use Tmdb\Repository\MovieRepository;

class WelcomeController extends Controller {

    private $movies;
    private $helper;

    public function __construct(MovieRepository $movies, ImageHelper $helper)
    {
        $this->movies = $movies;
        $this->helper = $helper;
    }

    /**
     * Show the application welcome screen to the user.
     *
     * @return Response
     */
    public function index()
    {
        $popular = $this->movies->getPopular();

        foreach ($popular as $movie)
        {
            $image = $movie->getPosterImage();
            echo ($this->helper->getHtml($image, 'w154', 260, 420));
        }
    }

}
```

The `Configuration` used by the `Tmdb\Helper\ImageHelper` is automatically loaded by the IoC container.

### Customizing outgoing requests

[](#customizing-outgoing-requests)

You can customize outgoing requests by listening for `BeforeRequestEvent` in one of your application's service providers.

```
namespace App\Providers;

use Event;
use Illuminate\Support\ServiceProvider;
use Tmdb\Event\BeforeRequestEvent;

class TmdbServiceProvider extends ServiceProvider {

    /**
     * Customize TMDB requests before they are sent.
     *
     * @return void
     */
    public function boot()
    {
        Event::listen(BeforeRequestEvent::class, function (BeforeRequestEvent $event) {
            $request = $event->getRequest()->withHeader('Accept-Language', 'nl-NL');

            $event->setRequest($request);
        });
    }

    /**
     * Register services
     * @return void
     */
    public function register()
    {
        // register any services that you need
    }
}
```

**For all all other interactions take a look at [php-tmdb/api](https://github.com/php-tmdb/api).**

###  Health Score

62

—

FairBetter than 99% of packages

Maintenance88

Actively maintained with recent releases

Popularity35

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity90

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~102 days

Recently: every ~90 days

Total

42

Last Release

59d ago

Major Versions

v4.0.5 → v5.0.02022-03-16

v5.0.0 → v6.0.02023-02-16

v6.0.2 → v7.0.02024-04-25

v7.0.0 → 12.02025-02-28

12.1.2 → 13.02026-03-20

PHP version history (5 changes)v0.1PHP &gt;=5.4.0

v2.0.0PHP &gt;=7.2.0

v4.0.0PHP &gt;=7.3.0

v5.0.0PHP &gt;=8.0

12.1PHP &gt;=8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/8ab1ab6b00f6fd0010e38a3ba0ae92a716be659f72b6febbb6a24bb6d8a599ac?d=identicon)[DariusIII](/maintainers/DariusIII)

---

Top Contributors

[![DariusIII](https://avatars.githubusercontent.com/u/3399658?v=4)](https://github.com/DariusIII "DariusIII (50 commits)")[![MarkRedeman](https://avatars.githubusercontent.com/u/1114829?v=4)](https://github.com/MarkRedeman "MarkRedeman (35 commits)")[![wtfzdotnet](https://avatars.githubusercontent.com/u/639376?v=4)](https://github.com/wtfzdotnet "wtfzdotnet (12 commits)")[![yukoff](https://avatars.githubusercontent.com/u/1076681?v=4)](https://github.com/yukoff "yukoff (9 commits)")[![CicerBro](https://avatars.githubusercontent.com/u/177757655?v=4)](https://github.com/CicerBro "CicerBro (3 commits)")[![z38](https://avatars.githubusercontent.com/u/3948085?v=4)](https://github.com/z38 "z38 (2 commits)")[![kon3ko](https://avatars.githubusercontent.com/u/50349884?v=4)](https://github.com/kon3ko "kon3ko (1 commits)")[![okaufmann](https://avatars.githubusercontent.com/u/4414498?v=4)](https://github.com/okaufmann "okaufmann (1 commits)")[![hiddeco](https://avatars.githubusercontent.com/u/10063039?v=4)](https://github.com/hiddeco "hiddeco (1 commits)")[![florentsorel](https://avatars.githubusercontent.com/u/1011503?v=4)](https://github.com/florentsorel "florentsorel (1 commits)")

---

Tags

phpapilaravelwrappermovietv showtvtvdbtmdb

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dariusiii-tmdb-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/dariusiii-tmdb-laravel/health.svg)](https://phpackages.com/packages/dariusiii-tmdb-laravel)
```

###  Alternatives

[php-tmdb/laravel

Laravel Package for TMDB ( The Movie Database ) API. Provides easy access to the wtfzdotnet/php-tmdb-api library.

16553.3k1](/packages/php-tmdb-laravel)[php-tmdb/api

PHP wrapper for TMDB (TheMovieDatabase) API v3. Supports two types of approaches, one modelled with repositories, models and factories. And the other by simple array access to RAW data from The Movie Database.

424378.6k16](/packages/php-tmdb-api)[wtfzdotnet/php-tmdb-api

PHP wrapper for TMDB (TheMovieDatabase) API v3. Supports two types of approaches, one modelled with repositories, models and factories. And the other by simple array access to RAW data from The Movie Database.

4252.9k](/packages/wtfzdotnet-php-tmdb-api)[php-tmdb/symfony

Symfony Bundle for TMDB (The Movie Database) API. Provides easy access to the php-tmdb/api library.

3649.7k](/packages/php-tmdb-symfony)[codebuglab/laravel-tmdb

Simple integration with TMDB ( The Movie Database ) API to retrieve their data.

145.5k](/packages/codebuglab-laravel-tmdb)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
