From 347dc5bd5a3ca3c441bfb5496f27eef2164fdcb6 Mon Sep 17 00:00:00 2001 From: ARCANEDEV Date: Mon, 1 Mar 2021 19:55:39 +0000 Subject: [PATCH] [9.x] Fixing the Error : Class "League\Flysystem\Adapter\Local" not found (#36407) * [9.x] Fixing the Error : Class "League\Flysystem\Adapter\Local" not found This is related to the new Flysystem v2 (Check the PR #33612) * Update VendorPublishCommand.php --- src/Illuminate/Foundation/Console/VendorPublishCommand.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Illuminate/Foundation/Console/VendorPublishCommand.php b/src/Illuminate/Foundation/Console/VendorPublishCommand.php index 842c3759da8a..45efdf65e611 100644 --- a/src/Illuminate/Foundation/Console/VendorPublishCommand.php +++ b/src/Illuminate/Foundation/Console/VendorPublishCommand.php @@ -6,8 +6,8 @@ use Illuminate\Filesystem\Filesystem; use Illuminate\Support\Arr; use Illuminate\Support\ServiceProvider; -use League\Flysystem\Adapter\Local as LocalAdapter; use League\Flysystem\Filesystem as Flysystem; +use League\Flysystem\Local\LocalFilesystemAdapter as LocalAdapter; use League\Flysystem\MountManager; class VendorPublishCommand extends Command @@ -254,8 +254,8 @@ protected function publishDirectory($from, $to) protected function moveManagedFiles($manager) { foreach ($manager->listContents('from://', true) as $file) { - if ($file['type'] === 'file' && (! $manager->has('to://'.$file['path']) || $this->option('force'))) { - $manager->put('to://'.$file['path'], $manager->read('from://'.$file['path'])); + if ($file['type'] === 'file' && (! $manager->fileExists('to://'.$file['path']) || $this->option('force'))) { + $manager->write('to://'.$file['path'], $manager->read('from://'.$file['path'])); } } }