CSV seems to work fine. Using this example code:
return Excel::create('ExcelTest')
->sheet('SheetName')
->with(array('data', 'data'))
->export('xlsx');
Running Laravel version 4.1.24
Screenshot of garbled xls file:

I can upload/send the xls and xlsx files if needed.
Thanks,
Alex Graham
Send the files to [email protected], I will have a look tomorrow morning
I confirm I can't open your files, but when I test the code you supplied with xls and xlsx I can open the just created files.
What kind of server are you running the code on? Are you using a different encoding than UTF-8?
I'm running the code on this vagrant server (
https://github.com/bryannielsen/Laravel4-Vagrant)
I also ran the code on my production server which is an Amazon EC2 server
running PHP 5.5 with the same result.
My files should all be saved as UTF-8, it is the default in my text editor
(Sublime 3). I tried resaving my routes.php (where I am calling the Excel
code from) specifically as UTF-8, problem persists.
On Wed, Apr 9, 2014 at 2:42 AM, Maatwebsite [email protected]:
I confirm I can't open your files, but when I test the code you supplied
with xls and xlsx I can open the just created files.What kind of server are you running the code on? Are you using a different
encoding than UTF-8?
Reply to this email directly or view it on GitHubhttps://github.com/Maatwebsite/laravel4-PHPExcel/issues/52#issuecomment-39933205
.
I fixed the issue-
One of the files I was autoloading began with an empty line instead of
Thanks again for the help.
Great :)
Having same problem ... but not rectifying .. pls help
I have attached the excel sheet. M using Laravel 5.* and running this code in localhost. Please check and same and tell me the solution to complete this.

Try following the thealexgraham 's suggestion. Every single time I saw this kind of error it had to do with a whitespace in front of <?php of after ?>
Hello my problem with this is I have large pack of files in my laravel. Is there a way how can I find the file with whitespace ?
Please add the code before your file download code
ob_end_clean();
ob_start();
@sachinshelke28 Thank you! This solved the problem.
Most helpful comment
Please add the code before your file download code
ob_end_clean();ob_start();