http://www.tuicool.com/articles/ziY7Vv
改写
public function index(){
$file = Input::file('myfile');
if($file){
//$realPath = $file
//$path = $file -> move(app_path().'/storage/uploads');
$realPath = $file->getRealPath();
$entension = $file -> getClientOriginalExtension(); //上传文件的后缀.
$newName = date('YmdHis').mt_rand(100,999).'.'.'xls';//$entension;
$path = $file->move(base_path().'/uploads',$newName);
$cretae_path = base_path().'/uploads/'.$newName;
//dd($cretae_path);
//dd($file);
Excel::load($cretae_path, function($reader) {
//$data = $reader->all();
//获取excel的第几张表
$reader = $reader->getSheet(0);
//获取表中的数据
$data = $reader->toArray();
dd($data);
});
}
return view('query.index');
}