//图片上传 public function upload(Request $request){ $file=$request->file(); //dd($request->file());exit; foreach($file as $key => $v){ $filename=$v->getClientOriginalName();//源文件名 $kuozhan=$v->getClientOriginalExtension();//扩展名 $filetype=$v->getClientMimeType();//MimeType $realpath=$v->getRealPath();//临时绝对路径 $filecun=date('Y-m-d-H-i-s').'-'.uniqid().'.'.$kuozhan; $reg=Storage::disk('public')->put($filecun,file_get_contents($realpath)); return asset('storage/'.$filecun); } }
Laravel最新特性结合Mysql异步消息队列、ElasticSearch搜索引擎、Debugbar调试利器开发简书
了解课程