clue/mq-react
clue/mq-react is a lightweight asynchronous message queue library for ReactPHP. It provides a simple producer/consumer API for enqueueing and processing messages, helping you build event-driven PHP applications with non-blocking I/O.
composer require clue/stream-filter. There is no Laravel service provider, facade, config file, or migration.Clue\StreamFilter\append(), Clue\StreamFilter\prepend(), and Clue\StreamFilter\remove().Storage and transform or redact it chunk-by-chunk before download or re-storage.use function Clue\StreamFilter\append;
$stream = Storage::disk('local')->readStream('exports/customers.csv');
$filter = append($stream, function (string $chunk): string {
// Strip UTF-8 BOM only if present at start, normalize CRLF, etc.
return str_replace("\r\n", "\n", $chunk);
});
return response()->streamDownload(function () use ($stream) {
try {
fpassthru($stream);
} finally {
fclose($stream);
}
}, 'customers.csv');
Storage::disk('s3')->readStream($path) → append filter → Storage::disk('local')->writeStream($target, $filteredStream).UploadedFile::getRealPath() → fopen($path, 'rb') → append sanitizer/redactor → stream response.$buffer = '';
$filter = append($stream, function (string $chunk) use (&$buffer): string {
$buffer .= $chunk;
$lines = explode("\n", $buffer);
$buffer = array_pop($lines);
return implode("\n", array_map(
fn (string $line) => preg_replace('/secret=\S+/', 'secret=[redacted]', $line),
$lines
)) . "\n";
});
CsvSanitizer, LogRedactor, StreamFilterPipeline, so jobs and controllers do not duplicate callbacks.finally. Use Storage::fake() and php://temp for tests.response()->streamDownload()) or Flysystem stream APIs; the package is not a replacement for League\Csv or Flysystem, it is a low-level filter layer.finally to avoid leaks.stream_get_contents() or $file->getContent() defeats the purpose. Consume incrementally with fread(), fpassthru(), or storage stream writes.strlen/substr/preg_* assumptions across chunk boundaries. Buffer or use PHP’s built-in conversion filters where appropriate.composer update clue/stream-filter, then your static analysis and stream-related tests. No migration or config change is expected.How can I help you explore Laravel packages today?