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) {