PHPackages                             wubs/trakt - 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. wubs/trakt

AbandonedLibrary[API Development](/categories/api)

wubs/trakt
==========

Trakt API wrapper

2.2.0(10y ago)341.3k16[3 issues](https://github.com/megawubs/trakt-api-wrapper/issues)[3 PRs](https://github.com/megawubs/trakt-api-wrapper/pulls)PHPPHP &gt;=5.4.7

Since Jan 8Pushed 4y ago5 watchersCompare

[ Source](https://github.com/megawubs/trakt-api-wrapper)[ Packagist](https://packagist.org/packages/wubs/trakt)[ RSS](/packages/wubs-trakt/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (12)Versions (9)Used By (0)

Notice: This package is abandoned by its maintainer. Please fork and continue from there.
=========================================================================================

[](#notice-this-package-is-abandoned-by-its-maintainer-please-fork-and-continue-from-there)

Trakt-api-wrapper version 2
===========================

[](#trakt-api-wrapper-version-2)

This is the Trakt API wrapper for their new API (version 2).

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

[](#installation)

In your composer.json file add:`"wubs/trakt": "~2.0"` and run `composer install`

The goal
--------

[](#the-goal)

The goal of this wrapper is to make communicating with the Trakt api easier. It aims to be easy, readable and usable in many cases. Designed as a composer package it can be easy installed inside a lager application.

Laravel usage
-------------

[](#laravel-usage)

To use the wrapper inside Laravel, you only have to add `Wubs\Trakt\Providers\Laravel\TraktApiServiceProvider::class` to the `providers` array in your `config/app.php` file. When you've done this, use the `\Wubs\Trakt\Trakt` class as a type hint to inject it into routes or methods. See here an example:

```
 Route::get(
    '/',
    function (\Wubs\Trakt\Trakt $trakt) {
        dump($trakt->movies->popular());
    }
);
```

### Non Laravel Usage

[](#non-laravel-usage)

If you don't use Laravel, you have to do a bit more to get it working.

Instantiating the Trakt API Wrapper
-----------------------------------

[](#instantiating-the-trakt-api-wrapper)

The API Wrapper needs one dependency. The `Wubs\Trakt\Auth` class, that in turn depends on `Wubs\Trakt\Provider\TraktProvider` The `TraktProvider` holds your client id, secret and your redirect url. To make an Auth object:

```
