Closed Sam-R closed 9 years ago
Quotation marks are required - I documented the actual element to add to the array, not the code you add.
That looks like a Laravel 5 namespaced-controller issue. I'm not all that familiar with L5, so I'm going to list a few things to try and hopefully one will work! Try them in order-
// 1
public function index()
{
$sh = \App::make('ShopifyAPI');
}
// 2
public function index(\RocketCode\Shopify\API $sh)
{
// $sh will already be instantiated
}
// 3
public function index()
{
$sh = new \RocketCode\Shopify\API;
}
I'm just starting out with Laravel myself, there's a lot to take in.
In actual fact, it appears all three work as solutions (at least I'm not getting an error any more).
Thanks for your help!
Hello,
I'm having problems when trying to initialize the the Shopify API:
in app/Http/Controllers/ShopifyController.php i have an index function:
This controller is loading, and can run other code, but the App:make('ShopifyAPI') line is causing the error.
My config/app.php has the following in it:
(Note: added quote marks which were not listed in your readme, but I believe they're required)
and composer has the following requirements:
I've run composer update and the /vendor/rocket-code folder has been added.
Is there something I'm missing that is required to get this working?