diff --git a/src/Listeners/AddAssetSymlinkFolders.php b/src/Listeners/AddAssetSymlinkFolders.php index b1d4d82..9386f7c 100644 --- a/src/Listeners/AddAssetSymlinkFolders.php +++ b/src/Listeners/AddAssetSymlinkFolders.php @@ -50,13 +50,15 @@ public function handle(ServeCommandStarted $event): void /** @var string $to */ $to = $pair['to']; - /** @var string $rootDirectory */ - $rootDirectory = Str::beforeLast($to, '/'); - - if ($this->files->isDirectory($to)) { + if (is_link($to)) { + $this->files->delete($to); + } elseif ($this->files->isDirectory($to)) { $this->files->deleteDirectory($to); } + /** @var string $rootDirectory */ + $rootDirectory = Str::beforeLast($to, '/'); + if (! $this->files->isDirectory($rootDirectory)) { $this->files->ensureDirectoryExists($rootDirectory); }