PHP code example of itsdizzy / trakt-api

1. Go to this page and download the library: Download itsdizzy/trakt-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

itsdizzy / trakt-api example snippets


Dizzy\Trakt\TraktServiceProvider::class

'Trakt' => Dizzy\Trakt\Facades\Trakt::class,



namespace App\Http\Controllers;

use Trakt;

class MoviesController extends Controller
{
    /**
     * @param $id
     * @return array
     */
    public function getMovie($id)
    {
        $movie = Trakt::movies()->withImages()->get($id);

        return [
            'movie' => $movie->toArray(),
            'people' => $movie->people(),
            'releases' => $movie->releases()
        ];
    }
}