From ba1595f75f58a3ccc0fb4ac96dda2212728db910 Mon Sep 17 00:00:00 2001 From: JaguarJack Date: Sat, 24 Apr 2021 20:31:45 +0800 Subject: [PATCH] =?UTF-8?q?update:=E6=96=B0=E5=A2=9E=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extend/catcher/CatchUpload.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/extend/catcher/CatchUpload.php b/extend/catcher/CatchUpload.php index eede7ed..4d685ca 100644 --- a/extend/catcher/CatchUpload.php +++ b/extend/catcher/CatchUpload.php @@ -84,6 +84,21 @@ class CatchUpload } } + /** + * 上传到 Local + * + * @time 2021年04月21日 + * @param $file + * @return string + */ + public function toLocal($file): string + { + $path = Filesystem::disk(self::LOCAL)->putFile($this->getPath(), $file); + + return public_path() . $this->getLocalPath($path); + } + + /** * 本地路径 * @@ -91,7 +106,7 @@ class CatchUpload * @param $path * @return string */ - protected function getLocalPath($path) + protected function getLocalPath($path): string { if ($this->getDriver() === self::LOCAL) {