alaouy / YouTube

🔥 Laravel PHP Facade/Wrapper for the Youtube Data API
MIT License
780 stars 205 forks source link

not working with Laravel 5 #3

Closed ghost closed 9 years ago

ghost commented 10 years ago

Hi tried library with Laravel 5(dev) and not working, getting class not found, is there any way that you could look what is problem???

Thx

alaouy commented 10 years ago

Hey @dbudimir, I just tested it on Laravel 5 and it works fine Don't forget to add the package's service provider 'Alaouy\Youtube\YoutubeServiceProvider', to app/config/app.php, apparently they changed its location to config/app.php

If the problem persists please let me know, I'll be happy to help :)

ghost commented 10 years ago

still not working, added all as you mention it and getting this Symfony \ Component \ Debug \ Exception \ FatalErrorException (E_ERROR) Class 'App\Http\Controllers\Youtube' not found

calling from index under HomeController $video = Youtube::getVideoInfo('oC-GflRB0y4');

added to providers in app/config/app.php and added key to config in config/packages/alaouy/youtube/config.php

no clue what else couldn't get wrong :( curent version with php artisan -v = Laravel Framework version 5.0-dev

P.S. works with latest 4.2.11

alaouy commented 10 years ago

I'll try to update the package for Laravel5 once it's stable enough, for now use the package without the facades, you can proceed like this :

<?php namespace App\Http\Controllers;

// import the package's class
use Alaouy\Youtube\Youtube;

class HomeController {

    public function index()
    {
        $youtube    = new Youtube('YOUR API KEY');
        $video      = $youtube->getVideoInfo('rie-hPVJ7Sw');
        $results    = $youtube->search('Android');
        //....
    }
}
ghost commented 10 years ago

Hi alaouy works with this approach :) thx hope soon you will update package for L5

alaouy commented 9 years ago

@dbudimir It's now updated to L5.

hassankhan commented 9 years ago

Hi, it doesn't work right now. There's quite a few fixes to get it running for L5, I can maybe do a PR later but can't guarantee it.

thorstenHe commented 8 years ago

Currently I get this error: BindingResolutionException in Container.php line 875: Unresolvable dependency resolving [Parameter #0 [ $key ]] in class Alaouy\Youtube\Youtube