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

mac03733's avatar

how to download database records as Execl files in Laravel 5.6

hi guys, iv been using maatwebsite/excel to download database records as excel files.this workes on my local machine but when i upload it to digital ocean VPS it doesnt download "give a whoops page". after doing some research i ran into a post that mentioned it might not be supported for long.

so can anyone please help with eighter a better solution to download excel files OR suggestions on how i can resolve my problem

I am using a LEMP stack incase this is relevant.

BY the way i am still new to all this :{ hence the possibly novice question

0 likes
2 replies
Faizan59's avatar
Faizan59
Best Answer
Level 1

Have you checked whether the package is installed in which you are trying to download the file. I have the same issue download was working on one server but not on other. download('xlsx') xlsx package was not installed i changed it to xls then it worked

1 like
mac03733's avatar

@Faizan59 ..thanks

xls worked ..after

-> composer require maatwebsite/excel ->composer require phpoffice/phpspreadsheet

in my case thats what i needed. i also had to restart the server afterwards

for some reason "maatwebsite/excel " was not installed on th vps when i update th packages

Please or to participate in this conversation.