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

masumbillah3416's avatar

Laravel export in same file

I want to export data to excel on time-based. I am using the Laravel excel package to export the data. Every hour I want to export some data to one single file using a cron job. my concern is now how to export on the same file. Thank you in advance.

0 likes
4 replies
Tray2's avatar

You need first to check if the file exists, if it does you need to open it and append the data, if it doesn't you need to create a new file.

Snapey's avatar

can't be done if you have sent the file to the client (with download)

Please or to participate in this conversation.