vitorccs / laravel-csv

PHP Laravel package to export and import CSV files in a memory-optimized way
MIT License
26 stars 5 forks source link

[Suggestion] Accessing the stream directly #8

Open JshGrn opened 1 year ago

JshGrn commented 1 year ago

Hi, I would be open to submitting a PR for this to add ->stream() to the exportable, this can just return getStream() from ExportableService.php I think...?

Use case is for when we are building csv files on the fly and sending them via email, we do not need to store them to disk and creates additional unrequired steps.

JshGrn commented 1 year ago

9 initial PR for this

vitorccs commented 3 months ago

@JshGrn I have just released v2.0 which adds importing feature + your requested featured

# will get the content in a stream (content placed in a temporary file)
return (new UsersExport)->stream();

See https://github.com/vitorccs/laravel-csv/issues/12