name); if (!$this->name) { throw new UploadException('请选择上传的图片'); } $info = $file->validate(config('admin.image'))->move(config('admin.local_upload_path')); if (!$info) { throw new UploadException($file->getError()); } return $info->getSaveName(); } catch (UploadException $exception) { return $exception->getMessage(); } } /** * Set Image Name * * @time at 2018年11月16日 * @param $name * @return $this */ public function name($name) { $this->name = $name; return $this; } }