Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependency Injection with Laravel #5

Open
bkintanar opened this issue Oct 17, 2013 · 6 comments
Open

Dependency Injection with Laravel #5

bkintanar opened this issue Oct 17, 2013 · 6 comments

Comments

@bkintanar
Copy link

I have a detailed my issue here: http://forums.laravel.io/viewtopic.php?pid=58597#p58597

@Anahkiasen
Copy link
Owner

It seems Laravel is resolving Flickering\Flickering to Flickering\Facades\Flickering, is there any App::bind or alias set that that way ?

@bkintanar
Copy link
Author

Well I've followed the tutorial here: http://www.mackhankins.com/blog/laravel/recent-flickr-photos-with-flickr-api-and-laravel

and it says to put the following in the app/config/app.php file

'aliases' => array(
'Flickering' => 'Flickering\Facades\Flickering'
)

@Anahkiasen
Copy link
Owner

Yeah but that's if you're going to use the Flickering facade directly, if you're going to use the class directly by injection, you don't need it.

@bkintanar
Copy link
Author

So I've tried removing the alias and what I'm getting now is

Call to undefined method Illuminate\Support\Facades\Config::get()

my code is

class PhotographyController extends BaseController {

    public function __construct(Flickering\Flickering $flickering)
    {
        $this->flickering = $flickering;

        $this->flickering->handshake(Config::get('flickr.app_key'), Config::get('flickr.api_secret'));
    }
}

@Anahkiasen
Copy link
Owner

Can you show me the full code of the controller ?

@bkintanar
Copy link
Author

I pasted it here: http://paste.laravel.com/ZHY

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants