PHPackages                             marcwelp/laravel-tvdb - 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. marcwelp/laravel-tvdb

ActiveLibrary[API Development](/categories/api)

marcwelp/laravel-tvdb
=====================

A TVDB API wrapper for Laravel.

v1.0.5(5y ago)01.2k[1 issues](https://github.com/LokiThor2021/laravel-tvdb/issues)MITPHP ^8.0

Since Jan 1Pushed 5y agoCompare

[ Source](https://github.com/LokiThor2021/laravel-tvdb)[ Packagist](https://packagist.org/packages/marcwelp/laravel-tvdb)[ RSS](/packages/marcwelp-laravel-tvdb/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (6)Used By (0)

Laravel TVDB API wrapper
========================

[](#laravel-tvdb-api-wrapper)

[![Latest Version on Packagist](https://camo.githubusercontent.com/7f7519f0ec60e9856770c88a2fa628cc718f2392528d43bb26a686cb57549985/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d61726377656c702f6c61726176656c2d747664622e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/marcwelp/laravel-tvdb)[![Quality Score](https://camo.githubusercontent.com/7d8f6b4881e84a7d9909dfb0e4114bfece25ced60fba26ad58817ce43e8cb47a/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6d61726377656c702f6c61726176656c2d747664622e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/marcwelp/laravel-tvdb)[![Total Downloads](https://camo.githubusercontent.com/bee7047301313f4dbc4e56bd3f8b2f404e204da2e0d0c2eadc0b06d25ddf1691/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d61726377656c702f6c61726176656c2d747664622e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/marcwelp/laravel-tvdb)

The `marcwelp/laravel-tvdb` package provides easy to use functions that help you interact with the TVDB API.

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

[](#installation)

You can install the package via composer:

```
composer require marcwelp/laravel-tvdb
```

Publish the config file with the following artisan command:

```
php artisan vendor:publish --provider="marcwelp\TVDB\TVDBServiceProvider"
```

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

[](#configuration)

The publish command above will publish a `tvdb.php` config file to your Laravel config folder. Be sure to tweak the values with your personal API details.
I recommend not touching the config file, but rather defining your API details in your project's `.env` file, like so:

```
TVDB_API_KEY=ETIO2B4NO372XP0X
TVDB_USER_KEY=XXUXCXR8LYXUNM7P
TVDB_USERNAME=marcwelp

```

Don't forget to clear recache your config. (`php artisan config:cache`)

Usage
-----

[](#usage)

### Finding series by ID

[](#finding-series-by-id)

The `getSeries` function returns a `Series` object.

```
// Find a series by its TVDB ID
// ID: 73739 (Lost)
$result = TVDB::getSeries(73739);

echo $result->title; // "Lost"
```

### Searching for series

[](#searching-for-series)

The `search` function returns an array of `Series` objects, or an empty array if no results are found.

```
// Search by title
$results = TVDB::search('Planet Earth');

// Search by IMDB ID
$results = TVDB::search(['imdbId' => 'tt5491994']);

// Search by zap2it ID
$results = TVDB::search(['zap2itId' => 'SH303483']);
```

### Getting series images

[](#getting-series-images)

In order get an array of a series' images, you need to specify the type of image you'd like to retrieve. Available types are listed below.

```
/*
 * Get the images of the series by TVDB ID
 * ID: 73739 (Lost)
 *
 * Available image types:
 * - TVDB::IMAGE_TYPE_FANART
 * - TVDB::IMAGE_TYPE_POSTER
 * - TVDB::IMAGE_TYPE_SEASON
 * - TVDB::IMAGE_TYPE_SERIES
 */
$images = TVDB::getSeriesImages(73739, TVDB::IMAGE_TYPE_POSTER);

// Or get the images directly from a "Series" object
$series = TVDB::getSeries(73739);
$images = $series->getImages(TVDB::IMAGE_TYPE_FANART);
```

### Getting series actors

[](#getting-series-actors)

The following options are available for retrieving an array of actors.

```
/*
 * Get the actors of the series by TVDB ID
 * ID: 73739 (Lost)
 */
$actors = TVDB::getSeriesActors(73739);

// Or get the actors directly from a "Series" object
$series = TVDB::getSeries(73739);
$actors = $series->getActors();
```

### Getting series episodes

[](#getting-series-episodes)

The TVDB API endpoint for retrieving episodes is paginated. This means that you will need to specify a page number when retrieving episodes.

```
/*
 * Get the episodes of the series by TVDB ID
 * ID: 73739 (Lost)
 *
 * The second parameter specifies the page (page 1 by default)
 */
$episodes = TVDB::getSeriesEpisodes(73739, 2);

// Or get the episodes directly from a "Series" object
$series = TVDB::getSeries(73739);

$episodes = $series->getEpisodes(2);
```

Example 1 - iterating over all episodes:

```
$page = 1;

do {
    $episodes = TVDB::getSeriesEpisodes(73739, $page);

    echo "Page $page has " . count($episodes) . " episodes. ";

    $page++;
} while($episodes->hasNextPage());

/*
 * Output:
 * Page 1 has 100 episodes.
 * Page 2 has 49 episodes.
 */
```

Example 2:

```
$episodes = TVDB::getSeriesEpisodes(73739);

foreach($episodes as $episode) {
    echo $episode->name . '';
}
```

### Getting individual episodes

[](#getting-individual-episodes)

```
/*
 * Retrieve the episode with ID 127131
 * .. returns an "Episode" object
 */
$episode = TVDB::getEpisode(127131);

echo $episode->name; //  "Pilot (1)"
```

### Getting your TVDB JWT token

[](#getting-your-tvdb-jwt-token)

Sometimes it can be useful to retrieve your TVDB JWT token (for testing the API, for example).

```
echo TVDB::getToken();
```

Credits
-------

[](#credits)

- [Musa Semou](https://github.com/marcwelp)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 71.4% of commits — single point of failure

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

Total

5

Last Release

1960d ago

PHP version history (2 changes)v1.0.0PHP ^7.1.3

v1.0.5PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/64dd923638d70842ebf918f801babf21e259f763ecbbf8d1ec9df06bb102fe03?d=identicon)[LokiThor2021](/maintainers/LokiThor2021)

---

Top Contributors

[![musa11971](https://avatars.githubusercontent.com/u/21341801?v=4)](https://github.com/musa11971 "musa11971 (10 commits)")[![MWelp](https://avatars.githubusercontent.com/u/12615029?v=4)](https://github.com/MWelp "MWelp (4 commits)")

### Embed Badge

![Health badge](/badges/marcwelp-laravel-tvdb/health.svg)

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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