diff --git a/src/Filesystem/FilesystemManager.php b/src/Filesystem/FilesystemManager.php index c31fa2e7b9..95e3c057ff 100644 --- a/src/Filesystem/FilesystemManager.php +++ b/src/Filesystem/FilesystemManager.php @@ -35,16 +35,16 @@ public function __construct(Container $app, array $diskLocalConfig, array $drive /** * @inheritDoc */ - protected function resolve($name): Filesystem + protected function resolve($name, $config = null): Filesystem { - $driver = $this->getDriver($name); - - $localConfig = $this->getLocalConfig($name); + $localConfig = $config ?? $this->getLocalConfig($name); if (empty($localConfig)) { throw new InvalidArgumentException("Disk [{$name}] has not been declared. Use the Filesystem extender to do this."); } + $driver = $config['driver'] ?? $this->getDriver($name); + if ($driver === 'local') { return $this->createLocalDriver($localConfig); }