get(ConfigInterface::class); $key = sprintf('databases.%s', $this->name); if (! $config->has($key)) { throw new InvalidArgumentException(sprintf('config[%s] is not exist!', $key)); } // Rewrite the `name` of the configuration item to ensure that the model query builder gets the right connection. $config->set("{$key}.name", $name); $this->config = $config->get($key); $options = Arr::get($this->config, 'pool', []); $this->frequency = make(Frequency::class, [$this]); parent::__construct($container, $options); } public function getName(): string { return $this->name; } protected function createConnection(): ConnectionInterface { return new Connection($this->container, $this, $this->config); } }