Download the PHP package dariusiii/tmdb-laravel without Composer
On this page you can find all versions of the php package dariusiii/tmdb-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package tmdb-laravel
Laravel Package for TMDB API Wrapper
A Laravel package that provides easy access to the 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.
Installation
Install Composer
Add the following to your require block in composer.json
config
or just run the following command in your project:
Configuration
Add config/app.php
(Laravel <5.5) the service provider:
Then publish the configuration file:
Laravel 5
Next you can modify the generated configuration file tmdb.php
accordingly.
That's all! Fire away!
Usage
We can choose to either use the Tmdb
Facade, or to use dependency injection.
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.
Dependency injection example
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.
In Laravel 5 instead of using the Event
facade we could also have used the EventServiceProvider
to register our event listener.
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.
The Configuration
used by the Tmdb\Helper\ImageHelper
is automatically loaded by the IoC container.
Registering plugins
Plugins can be registered in a service provider using the boot()
method.
For all all other interactions take a look at php-tmdb/api.
All versions of tmdb-laravel with dependencies
illuminate/support Version ^8.0|^9.0|^10.0|^11.0
php-tmdb/api Version ^4.0
nyholm/psr7 Version ^1.3
guzzlehttp/guzzle Version ^7.2