Hi all,
I'm new to Lumen and Laravel, sorry if I'm missing something obvious!
I'm working on a small app that needs to interface with the Bigcommerce API. They have a PHP library, and from my understanding, it would make sense to create a service provider (or container?) to return an instance of the Bigcommerce API client. However, their library is written such that all methods are accessed statically rather than via an instance, so rather than something like:
use Bigcommerce\Api\Client as Bigcommerce;
$client = new Bigcommerce($connection_info);
$products = $client->getProducts();
Where the $client instance could be returned by a service provider, it works like:
use Bigcommerce\Api\Client as Bigcommerce;
Bigcommerce::configure($connection_info);
$products = Bigcommerce::getProducts();
So I can't just return an instance. I could just do the ::configure call in my bootstrap.php, and make the static calls in my code where I need to, but I was wondering what the best approach might be for Lumen?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community