'local', 'storage' => [ 'local' => [ 'driver' => LocalAdapterFactory::class, 'root' => \runtime_path(), 'url' => '', ], ], ]) : $config; $adapter = static::getAdapter($options, $adapterName); return new Filesystem($adapter, $options['storage'][$adapterName] ?? []); } public static function getAdapter($options, $adapterName) { if (! $options['storage'] || ! $options['storage'][$adapterName]) { throw new \Exception("file configurations are missing {$adapterName} options"); } /** @var AdapterFactoryInterface $driver */ $driver = Container::get($options['storage'][$adapterName]['driver']); return $driver->make($options['storage'][$adapterName]); } /** * @param $name * @param $arguments * @return mixed */ public static function __callStatic($name, $arguments) { return static::instance()->{$name}(... $arguments); } }