PHPackages                             sudiptochoudhury/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. sudiptochoudhury/tmdb-laravel

ActiveLibrary[API Development](/categories/api)

sudiptochoudhury/tmdb-laravel
=============================

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

12.1.2(2mo ago)02MITPHPPHP &gt;=8.0.2

Since Aug 28Pushed 2mo agoCompare

[ Source](https://github.com/sudiptochoudhury/tmdb-laravel)[ Packagist](https://packagist.org/packages/sudiptochoudhury/tmdb-laravel)[ RSS](/packages/sudiptochoudhury-tmdb-laravel/feed)WikiDiscussions master Synced today

READMEChangelog (3)Dependencies (26)Versions (5)Used By (0)

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

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

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. Both Laravel 5 and 6 are supported.

[![Latest Stable Version](https://camo.githubusercontent.com/59897cdf2803581e08a0a37f4bfdd5c3cc79afa69839b42b006edb4df5426acf/687474703a2f2f706f7365722e707567782e6f72672f7375646970746f63686f7564687572792f746d64622d6c61726176656c2f76)](https://packagist.org/packages/sudiptochoudhury/tmdb-laravel)[![Total Downloads](https://camo.githubusercontent.com/98b0b2026f458ec7e8f8093c917e434c6727b31728f62b38b5c3ae2d0bcb6c11/687474703a2f2f706f7365722e707567782e6f72672f7375646970746f63686f7564687572792f746d64622d6c61726176656c2f646f776e6c6f616473)](https://packagist.org/packages/sudiptochoudhury/tmdb-laravel)[![Latest Unstable Version](https://camo.githubusercontent.com/57ecc055c8086fc3c231e312f0098160c4047657016a47f432b231dbb261a8c0/687474703a2f2f706f7365722e707567782e6f72672f7375646970746f63686f7564687572792f746d64622d6c61726176656c2f762f756e737461626c65)](https://packagist.org/packages/sudiptochoudhury/tmdb-laravel)[![License](https://camo.githubusercontent.com/03b452055993f0c64a691b2bd83bab1bd43dcabebe509b9e6f99175a6f0506b0/687474703a2f2f706f7365722e707567782e6f72672f7375646970746f63686f7564687572792f746d64622d6c61726176656c2f6c6963656e7365)](https://packagist.org/packages/sudiptochoudhury/tmdb-laravel)[![PHP Version Require](https://camo.githubusercontent.com/6bf977b497824850ec41aac256ad47487c0813a1ed6dd4082b7080dc893e6906/687474703a2f2f706f7365722e707567782e6f72672f7375646970746f63686f7564687572792f746d64622d6c61726176656c2f726571756972652f706870)](https://packagist.org/packages/sudiptochoudhury/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

```
"sudiptochoudhury/tmdb-laravel": "^2.1"

```

or just run the following command in your project:

```
composer require sudiptochoudhury/tmdb-laravel

```

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

[](#configuration)

Add `config/app.php` (Laravel &lt;= 8) the service provider:

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

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

Then publish the configuration file:

### Laravel 5

[](#laravel-5)

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

```

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.

### 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; // optional for Laravel ≥5.5

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 Log;
use Event;
use Tmdb\Event\TmdbEvents;
use Tmdb\Event\RequestEvent;

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

In Laravel 5 instead of using the `Event` facade we could also have used the `EventServiceProvider` to register our event listener.

### 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.

### Registering plugins

[](#registering-plugins)

Plugins can be registered in a service provider using the `boot()` method.

```
namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use Tmdb\HttpClient\Plugin\LanguageFilterPlugin;

class TmdbServiceProvider extends ServiceProvider {

    /**
     * Add a Dutch language filter to the Tmdb client
     *
     * @return void
     */
    public function boot()
    {
        $plugin = new LanguageFilterPlugin('nl');
        $client = $this->app->make('Tmdb\Client');
        $client->getHttpClient()->addSubscriber($plugin);
    }

    /**
     * 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

37

—

LowBetter than 81% of packages

Maintenance86

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 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 ~119 days

Total

3

Last Release

72d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/809353?v=4)[Sudipto Choudhury](/maintainers/sudiptochoudhury)[@sudiptochoudhury](https://github.com/sudiptochoudhury)

---

Top Contributors

[![DariusIII](https://avatars.githubusercontent.com/u/3399658?v=4)](https://github.com/DariusIII "DariusIII (42 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)")[![sudiptochoudhury](https://avatars.githubusercontent.com/u/809353?v=4)](https://github.com/sudiptochoudhury "sudiptochoudhury (6 commits)")[![z38](https://avatars.githubusercontent.com/u/3948085?v=4)](https://github.com/z38 "z38 (2 commits)")[![okaufmann](https://avatars.githubusercontent.com/u/4414498?v=4)](https://github.com/okaufmann "okaufmann (1 commits)")[![kon3ko](https://avatars.githubusercontent.com/u/50349884?v=4)](https://github.com/kon3ko "kon3ko (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/sudiptochoudhury-tmdb-laravel/health.svg)

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

###  Alternatives

[dariusiii/tmdb-laravel

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

1821.2k](/packages/dariusiii-tmdb-laravel)[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.

435383.9k17](/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.

4262.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.8k](/packages/php-tmdb-symfony)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)

PHPackages © 2026

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