Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSV download includes Laravel debugbar scripts and styles #49

Closed
ankurk91 opened this issue Sep 4, 2018 · 2 comments
Closed

CSV download includes Laravel debugbar scripts and styles #49

ankurk91 opened this issue Sep 4, 2018 · 2 comments

Comments

@ankurk91
Copy link

ankurk91 commented Sep 4, 2018

Hi,

When we have laravel debugbar installed and try to download csv, the csv file includes the laravel debugbar scripts and styles along with actual records.

// Code to reproduce the issue
Route::get('test', function () {
    return (new \Rap2hpoutre\FastExcel\FastExcel(\App\Models\User::all()))->download('users-list.csv');
});
// How i fixed this issue
Route::get('test', function () {
    return response()->streamDownload(function () {
        return (new \Rap2hpoutre\FastExcel\FastExcel(\App\Models\User::all()))->download('users-list.csv');
    });
});

If possible please add this piece of code to docs somewhere.

Thanks.

@rap2hpoutre
Copy link
Owner

Hi, thank your for your contribution! And thank you for the workaround you provided! 👍

If possible please add this piece of code to docs somewhere.

I think it could be even better to actually add your code in the lib itself, in order to make it work for everybody without having to read the doc! I just pushed this here: c87837f.

I will release it ASAP!

@rap2hpoutre
Copy link
Owner

🎉 Available in v0.8.0 thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants