I am using below code to Export into .xlsx using package maatwebsite/excel
$fileName = 'Stats-GroupID_' . $groupId . '-' . time() . '.xlsx';
return Excel::download($statsExport->setGroupId($groupId), $fileName);
The output is filled with broken characters: � as shown in the screenshot.
I tried ob_end_clean();
It was working, but I'm not sure whether it will break anything across my projects, so don't want to use it.
Try calling ob_start method after ob_end_clean as follows