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

Laravel facade does not load the client #13

Open
etorofiev opened this issue Feb 24, 2015 · 3 comments
Open

Laravel facade does not load the client #13

etorofiev opened this issue Feb 24, 2015 · 3 comments

Comments

@etorofiev
Copy link

I'm unable to load the Client using the Laravel facade. If I change the getFacadeAccessor() method to return 'Shopify\Client' instead of 'shopify', it works fine though. Isn't the facade supposed to return the Client instead of just 'shopify'?

@elyobo
Copy link
Contributor

elyobo commented Feb 25, 2015

I'm not familiar with Laravel, but all of the examples showing how to write Laravel facades return a string from the getFacadeAccessor(), not the underlying object, which is instead somehow bound to the application. I can't say that the rest of the implementation is correct (there is some sort of binding of the real underlying object going on in https://github.com/ShopifyExtras/PHP-Shopify-API-Wrapper/blob/master/src/Laravel/ServiceProvider.php), but the getFacadeAccessor() part definitely seems correct.

@etorofiev
Copy link
Author

Yes, it turned out I had overwritten my app/config/app.php file with the array of Service Providers, and the facade is working properly after I fixed it.

I would however add a line in the readme file for reminding people who use Laravel to include that service provider in their app.php file, since it's easy to forget it otherwise :)

@elyobo
Copy link
Contributor

elyobo commented Feb 26, 2015

I'm sure that @cargi would be happy for a pull request that adds appropriate docs. I don't have a clue about Laravel, so I can't do it :D

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