Fixes issue with Laravel 8.48 filesystem changes

The FilesystemManager has changed to also allow to override
the config while resolving a filesystem.

This PR adds the argument and applies it if provided.
This commit is contained in:
Daniel Klabbers 2021-06-22 21:20:00 +02:00 committed by Daniël Klabbers
parent 1cf9491fe6
commit 6e92af8b00

View File

@ -35,16 +35,16 @@ class FilesystemManager extends LaravelFilesystemManager
/**
* @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);
}