From 2ec8cca7f5491e8cf79477bd50c3b1f1b0237575 Mon Sep 17 00:00:00 2001
From: laraveladmin <76767270+laraveladmin-cn@users.noreply.github.com>
Date: Thu, 2 Dec 2021 13:28:27 +0800
Subject: [PATCH] bug:File soft connection
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Generate file relative path soft connection;
生成文件相对路径软连接
---
 Filesystem.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Filesystem.php b/Filesystem.php
index 524d17c2b..b2b65f881 100644
--- a/Filesystem.php
+++ b/Filesystem.php
@@ -508,7 +508,7 @@ public function makePathRelative(string $endPath, string $startPath)
         $endPathRemainder = implode('/', \array_slice($endPathArr, $index));
 
         // Construct $endPath from traversing to the common path, then to the remaining $endPath
-        $relativePath = $traverser.('' !== $endPathRemainder ? $endPathRemainder.'/' : '');
+        $relativePath = $traverser.('' !== $endPathRemainder ? (is_dir($endPath)?$endPathRemainder.'/':$endPathRemainder) : '');
 
         return '' === $relativePath ? './' : $relativePath;
     }