How to display currency symbols in laravel Excel

Viewed 27

One of the fields of my laravel collection pulled from our database is a currency Field. I am exporting this using Laravel Excel.

The resulting export however shows the currency symbol as a quetion mark.

I am guessing I need to set the font using the WithStyle concern.

Does the Stack Overflow community know how to set the font so proper currency symbol is displayed in my exported xlsx file?

1 Answers

If you don't have config/excel.php, run the following command:

php artisan vendor:publish --provider="Maatwebsite\Excel\ExcelServiceProvider" --tag=config

After that, find the following line in config/excel.php:

'use_bom' => false,

Replace with the following:

'use_bom' => true,
Related