| 12345678910111213141516171819202122232425262728293031 | 
							- <?php
 
- namespace App\Exports;
 
- use Maatwebsite\Excel\Facades\Excel;
 
- class MyExport {
 
-     public $base1_path = '/app';
 
-     public $base2_path = '/excel';
 
-     public function commonExport($data,$path = ''){
 
-         if(empty($path)) $path = date('YmdHis').rand(1000,9999).'.xlsx';
 
-         $param = $data;
 
-         $export = new CommonExport($param);
 
-         $date = date('Ymd');
 
-         $path = $date.'/'.$path;
 
-         Excel::store($export, $path);
 
-         return ['file'=>$this->base2_path.'/'.$path];
 
-     }
 
-     public function excelDownload($file){
 
-         return response()->file(storage_path().$this->base1_path.$this->base2_path.'/'.$file);
 
-     }
 
- }
 
 
  |