Custom Downloader to allow for people running Laravel Vapor to suppor… - #20285
Open
bretto36 wants to merge 1 commit into
Open
Custom Downloader to allow for people running Laravel Vapor to suppor…#20285bretto36 wants to merge 1 commit into
bretto36 wants to merge 1 commit into
Conversation
…t downloading of files
bretto36
commented
Jul 27, 2026
|
|
||
| echo $disk->get($file); | ||
| return response()->streamDownload(function () use ($export): void { | ||
| foreach (app(CsvExportContent::class)($export) as $chunk) { |
Contributor
Author
There was a problem hiding this comment.
I moved the creation of the content to a separate class so that someone can extend the CSVDownloader/XsxDownloader and only override the invoke method, without having to touch the actual creation of the rows
bretto36
commented
Jul 27, 2026
| return [ExportFormat::Csv, ExportFormat::Xlsx]; | ||
| } | ||
|
|
||
| public static function getDownloader(ExportFormatInterface $format): Downloader |
Contributor
Author
There was a problem hiding this comment.
Allows someone to specify their own downloader depending on the Formatter used
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…t downloading of files
Description
Allow the ability to customise the Downloader for an export action. I use Laravel Vapor, and large files get blocked by the Load Balancer/Lambda/API Gateway - https://docs.vapor.build/projects/development#binary-responses - Streamed responses don't seem to work for larger files.
This allows someone to specify a new downloader on their Export - I am planning on making a Filament Plugin for this so that people can simply use a Trait from the package.
I'd like your thoughts on the viability of this. Best case scenario is changing the existing system to automatically recognise Vapor and return a redirect to an S3 url instead of trying to stream it. But the last PR for that seemed to go no where. I figured this extends the system so that people can do whatever they want. Perhaps people could stream it if it's below a threshold or upload and return the s3 url if not.
Visual changes
Functional changes
composer cscommand.