public function connection(?string $using, Closure $callback, array $options = []): void
    {
        $repository = $this->app->make('config');

        if (\is_null($using)) {
            $using = $repository->get('database.default');
        }

        $config = $repository->get("database.connections.{$using}", null);

        if (\is_null($config)) {
            throw new InvalidArgumentException("Database connection [{$using}] is not available.");
        }

        Arr::set($this->config, 'connection', [
            'name' => "{$using}_{id}",
            'template' => $config,
            'resolver' => $callback,
            'options' => $options,
        ]);
    }