/** * Use or instantiate a Flysystem disk * * @param string $dir The value from one of the config dirs * @return League\Flysystem\Filesystem | League\Flysystem\Cached\CachedAdapter */ public function makeDisk($dir) { // Check if the dir refers to an IoC binding and return it if ($this->app->bound($dir) && ($instance = $this->app->make($dir)) && (is_a($instance, 'League\\Flysystem\\Filesystem') || is_a($instance, 'League\\Flysystem\\Cached\\CachedAdapter'))) { return $instance; } // Instantiate a new Flysystem instance for local dirs return new Filesystem(new Adapter($dir)); }