update:新增本地上传方法

This commit is contained in:
JaguarJack 2021-04-24 20:31:45 +08:00
parent 566514f729
commit ba1595f75f

View File

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