如果路径下有相同命名的文件,新文件会覆盖老文件

    1. $config = [
    2. 'path' => '/home/viest' // xlsx文件保存路径
    3. ];
    4. $excel = new \Vtiful\Kernel\Excel($config);
    5. // fileName 会自动创建一个工作表,你可以自定义该工作表名称,工作表名称为可选参数
    6. $filePath = $excel->fileName('tutorial01.xlsx', 'sheet1')
    7. ->header(['Item', 'Cost'])
    8. ->data([
    9. ['Rent', 1000],
    10. ['Gas', 100],
    11. ['Food', 300],
    12. ['Gym', 50],
    13. ])
    14. ->output();