您好,我真的是使用 maatwebsite 的新手,已经阅读了文档,但找不到它,有人可以给我一个关于使用 maatwebsite 导出 excel 后执行查询的想法吗?这是我的代码:
public function export()
{
Excel::download(new KodePosExport, 'KodePos.xlsx');
KodePos::query()->truncate();
return redirect('/')->with('success', 'All good!');
}
它可以重定向到我想要的页面并截断数据,但不能导出 Excel,我该怎么做?谢谢
如果使用此功能导出 Excel 工作正常,但不包含查询
public function export()
{
return Excel::download(new KodePosExport, 'KodePos.xlsx');
//KodePos::query()->truncate();
// return redirect('/')->with('success', 'All good!');
}
MMMHUHU
子衿沉夜