Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Pipeline Laravel Package

sanmai/pipeline

sanmai/pipeline is a fluent, memory-efficient PHP library for processing any iterable with lazy generators. Chain map, filter, reduce, zip, and more for readable pipelines that handle large or infinite collections without exhausting memory.

View on GitHub
Deep Wiki
Context7

sanmai/pipeline is a fluent, memory-efficient library for processing iterable data in PHP. Built on lazy evaluation with generators, it lets you chain operations into readable pipelines that process items one at a time—ideal for large or even infinite collections. Requires PHP 8.2+.

  • Fluent API — chain map, filter, reduce, zip, and more
  • Lazy by design — items flow one at a time, only when needed
  • Memory-efficient — handles huge or unbounded datasets without exhausting memory
  • Flexible inputs — accepts arrays, generators, and iterators
  • Robust — rigorously tested; neither defines nor throws exceptions
Frequently asked questions about Pipeline
What is sanmai/pipeline and how does it fit into Laravel applications?
sanmai/pipeline is a Composer package for building fluent, lazy pipelines in PHP. It lets you chain operations like map, filter, reduce, and zip over arrays, generators, or any iterable. In Laravel it fits naturally in service classes, command handlers, and queued jobs for sequential data processing without coupling to the framework.
How do I install sanmai/pipeline with Composer?
Run composer require sanmai/pipeline in your Laravel project. The latest release requires PHP 8.2 or above, so confirm your runtime before installing. No Laravel service provider or additional configuration is required.
Does sanmai/pipeline support Laravel and which PHP versions are supported?
The package is framework-agnostic and works in Laravel because it is a standard Composer package. The latest version requires PHP 8.2 or higher; some older releases support PHP 5.6 and above but are less feature-complete. Check the package composer.json against your application runtime before rollout.
How does sanmai/pipeline handle large or infinite collections without exhausting memory?
It uses lazy evaluation with generators, so items are processed one by one only when needed. That makes it suitable for large or even infinite iterables where eager array operations would consume too much memory. You can chain map, filter, and other stages without materializing the entire collection.
What is the difference between sanmai/pipeline and Laravel collections?
Laravel Collections are eager, array-backed helpers with a broad Laravel-specific API. sanmai/pipeline focuses on lazy, memory-efficient processing of any iterable, including generators, with a fluent pipe-style API. Choose it when streaming, large datasets, or non-HTTP domain logic matter more than Collection macros.
How do I chain map, filter, reduce, and zip in sanmai/pipeline?
Wrap your iterable with the take helper, then chain stages such as map, filter, reduce, and zip. The pipeline evaluates lazily, so transformations run as items flow through. You can also zip multiple iterables side by side without converting them to arrays first.
Does sanmai/pipeline throw exceptions or require error handling?
No, the library neither defines nor throws any exceptions, which keeps pipeline code predictable. Errors from your own callbacks can still occur, so handle application-specific failures in your stages. The package itself avoids exception-based control flow.
What changed in sanmai/pipeline 7.12 regarding skipWhile?
Release 7.12 fixes skipWhile so predicate evaluation stops once a match is found. This is a behavioral bug fix with no new public API and no required code changes. Review any pipeline that relied on the predicate continuing to run after a match, especially with side-effectful predicates.
Should I pin sanmai/pipeline to ^7.12 and add a skipWhile regression test?
Pinning to ^7.12 is reasonable because the release is a backward-compatible patch within 7.x. Add a regression test if your production pipelines use skipWhile, particularly with expensive or side-effectful predicates. This verifies the new short-circuit behavior before promotion.
Is sanmai/pipeline safe for production and queued jobs in Laravel?
Technical risk for 7.12 is low: it contains one behavioral fix plus documentation and chore updates, with no breaking changes or deprecations. It integrates cleanly into Laravel service classes and queued jobs with a trivial Composer install. Upgrade in non-production first, run your test suite, and then promote through your normal release process.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console