Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ZandA's avatar
Level 1

Laravel export excel No ReaderType or WriterType could be detected. Make sure you either pass a valid extension to the filename or pass an explicit type.

"No ReaderType or WriterType could be detected. Make sure you either pass a valid extension to the filename or pass an explicit type." and I've checked my file extension is ok. here is my code:

return Excel::download(new PropertyDetailExport($request), 'exports.xlsx');

0 likes
7 replies
Amy69's avatar

I think the exception message is pretty clear. Make sure that it has an extension, or be explicit and pass a writer/reader type.

ZandA's avatar
Level 1

@siangboon Thank you for reply, I've just found a solution; add a third parameter, it works fine.

Josadec's avatar

@Saren Um What was the solution in your case I have the same problem, could you share the solution? please.

ZandA's avatar
ZandA
OP
Best Answer
Level 1

@Josadec here is my code:

return Excel::download(new BookingExport($data),'booking-report.xlsx');

change to

use Maatwebsite\Excel\Excel as ExcelExcel;
use Maatwebsite\Excel\Facades\Excel;



return Excel::download(new BookingExport($data),'booking-report.xlsx',ExcelExcel::XLSX);
1 like

Please or to participate in this conversation.