Custom CSV Settings

By default Laravel Excel uses the defaults from the config (config/excel.php). You can change this by adding the WithCustomCsvSettings interface.

namespace App\Exports;

use Maatwebsite\Excel\Concerns\WithCustomCsvSettings;

class InvoicesExport implements WithCustomCsvSettings
{    
    public function getCsvSettings(): array
    {
        return [
            'delimiter' => ';'
        ];
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13

Available settings

  • delimiter
  • enclosure
  • line_ending
  • use_bom
  • include_separator_line
  • excel_compatibility