导出结果
修改: \vendor\laravel-admin\src\Grid\Exporters\CsvExporter.php
增加:
print(chr(0xEF).chr(0xBB).chr(0xBF));
例如:
*/
public function export()
{
$filename = $this->getTable().'.csv';
//增加这一行
print(chr(0xEF).chr(0xBB).chr(0xBF));
$headers = [
'Content-Encoding' => 'UTF-8',
'Content-Type' => 'text/csv;charset=UTF-8',
'Content-Disposition' => "attachment; filename=\"$filename\"",
];
再次导出: