In this example, I am trying to configure a package through a service provider for 2 separate account connections to Xero.
In the service provider:
public function register()
{
// Merge defaults
$this->mergeConfigFrom(
__DIR__.'/../config.php', 'xero.config'
);
// Grab config
$config = $this->app->config->get('xero.config');
$this->app->bind('XeroPrivate', function () use ($config) {
return new \XeroPHP\Application\PrivateApplication($config);
});
...
I have a new config loaded in $config = $this->app->config->get('xero.config2');
What is the best way to switch between these configurations?
I think this has to be done at the service provider level, so is it best to make 2 service providers and bind each configuration to a different key?