diff --git a/src/Illuminate/Foundation/Console/VendorPublishCommand.php b/src/Illuminate/Foundation/Console/VendorPublishCommand.php index 8617b34dc8db..b41e01eaf53f 100644 --- a/src/Illuminate/Foundation/Console/VendorPublishCommand.php +++ b/src/Illuminate/Foundation/Console/VendorPublishCommand.php @@ -7,6 +7,7 @@ use Illuminate\Foundation\Events\VendorTagPublished; use Illuminate\Support\Arr; use Illuminate\Support\ServiceProvider; +use Illuminate\Support\Str; use League\Flysystem\Filesystem as Flysystem; use League\Flysystem\Local\LocalFilesystemAdapter as LocalAdapter; use League\Flysystem\MountManager; @@ -259,8 +260,10 @@ protected function publishDirectory($from, $to) protected function moveManagedFiles($manager) { foreach ($manager->listContents('from://', true) as $file) { - if ($file['type'] === 'file' && (! $manager->fileExists('to://'.$file['path']) || $this->option('force'))) { - $manager->write('to://'.$file['path'], $manager->read('from://'.$file['path'])); + $path = Str::after($file['path'], 'from://'); + + if ($file['type'] === 'file' && (! $manager->fileExists('to://'.$path) || $this->option('force'))) { + $manager->write('to://'.$path, $manager->read($file['path'])); } } }