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

AbandonedLibrary[API Development](/categories/api)

nntmux/trakt
============

Trakt API wrapper

3.0.2(8y ago)0113GPL-3.0-onlyPHPPHP &gt;=7.2

Since Jan 8Pushed 8y ago1 watchersCompare

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

READMEChangelog (3)Dependencies (13)Versions (12)Used By (0)

[![Build Status](https://camo.githubusercontent.com/755cb0ee5d402b45e1aacf41cfe7e75c0b9b386db5ed2d903f4d9aa9499251c1/68747470733a2f2f7472617669732d63692e6f72672f4e4e546d75782f7472616b742d6170692d777261707065722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/NNTmux/trakt-api-wrapper)

Notice: This package is a fork of now abandoned megawubs/trakt-api-wrapper
==========================================================================

[](#notice-this-package-is-a-fork-of-now-abandoned-megawubstrakt-api-wrapper)

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

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

This is the Trakt API wrapper for their new API (version 2). It's in active development

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

[](#installation)

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

Or you can issue: `composer require nntmux/trakt`

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 `NNTmux\Trakt\Providers\Laravel\TraktApiServiceProvider::class` to the `providers` array in your `config/app.php` file. When you've done this, use the `\NNTmux\Trakt\Trakt` class as a type hint to inject it into routes or methods. See here an example:

```
 Route::get(
    '/',
    function (\NNTmux\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 `NNTmux\Trakt\Auth` class, that in turn depends on `NNTmux\Trakt\Provider\TraktProvider` The `TraktProvider` holds your client id, secret and your redirect url. To make an Auth object:

```
