megawubs / trakt-api-wrapper

A Object Oriented PHP wrapper for the trakt api
34 stars 19 forks source link

Laravel 5.1 example #18

Closed ghost closed 8 years ago

ghost commented 8 years ago

i followed this tutorial http://blog.wubsinfo.nl/trakt-api-wrapper/setup/oauth.html in laravel 5.1 but its not working can you show me an example for laravel pls

btw when i use

<?php
namespace App\Http\Controllers;
use Wubs\Trakt\Trakt;

class MovieController extends Controller {

    protected $trakt;

    function __construct(Trakt $trakt) {
       $this->trakt = $trakt;
    }

    public function index() {
        $trending = $this->trakt->movies->popular();
        ~r($trending); //pretty var_dump
        return view('movies.index');
   }
}

im getting

Client error response [url] https://api-v2launch.trakt.tv/movies/popular?extended=min&page=1&limit=10 [status code] 403 [reason phrase] Forbidden

and thats because the client_id is not defined, but how do i define it ?

megawubs commented 8 years ago

@DeeJaVu I've been busy updating the docks. Haven't pushed it yet as it needs it final polishing. The readme also shows how to use it with Laravel.

ghost commented 8 years ago

Oke thank you

SrPatinhas commented 8 years ago

@DeeJaVu you got your code working? im getting an error in this part too :( this should have a better example how to implement. @megawubs did you got your docs updated? Thanks in advance

ghost commented 8 years ago

@SrPatinhas no i gave up, instead im using https://github.com/php-tmdb/laravel

SrPatinhas commented 8 years ago

@DeeJaVu thanks. i will try a little bit more this package ;)