Open etorofiev opened 9 years ago
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.
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 :)
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
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'
?