我找到了解决方案。我不知道这是不是最好的方式,但似乎有效(在当地):
$doc = Storage::disk(‘doc’)->getAdapter()->getPathPrefix();
$path = public_path().’\‘.$doc;
$files = new Filesystem;
$dir = $files->directories($path);
print_r($dir);
</code>
阵列不是空的!
别忘了:
use Storage;
use Illuminate\Filesystem\Filesystem;
</code>