Support the ongoing development of Laravel.io →
IOC Packages

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?

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

aharvie aharvie Joined 22 Apr 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.