justbetter/laravel-magento-client

How to create instance with manual credentials?

Closed this issue · 1 comments

I want to create a Magento instance manually with my db config. Something like

$magento = Magento::factoryCreate($baseUrl, $token);

Hi @vimal-360,

When creating the Magento client, it instantiates an instance of BuildRequest as well. This class will build up the HTTP request using the values stored in the magento configuration file.

Currently, our client does not support multiple Magento instances with a different configuration at the same time. However, you can programmatically update the configuration values.

config()->set('magento.base_url', $baseUrl);
config()->set('magento.access_token', $token);

$magento = app(\JustBetter\MagentoClient\Client\Magento::class);