rap2hpoutre / fast-excel

🦉 Fast Excel import/export for Laravel
MIT License
2.08k stars 246 forks source link

Allow for explicit output filetype selection #348

Open alexszeliga opened 6 months ago

alexszeliga commented 6 months ago

In my use case, I want to stream my export to a download without creating a file, so I use the PHP write only output stream, php://output, but that limits me to using xlsx, with no way to stream csv.

I changed the signature to the download and export methods to allow for an optional extension. When provided, it allows the developer to explicitly select any file type, regardless of filename.

alexszeliga commented 6 months ago

I simplified the complexity issue and removed a Laravel Str helper dependency, since PHP 8 has semantic methods to replace them.