phphd/pipeline-bundle
A Symfony bundle for building reusable PHP pipelines with a clean, stage-based API. Chain processing steps, pass data through each stage, and organize complex workflows into testable, configurable components that fit naturally into Symfony applications.
composer require phd/pipeline) and let Laravel auto-discover the service provider.php artisan vendor:publish --tag=phd_pipeline-config. The main file is typically config/phd_pipeline.php.phd_pipeline.forward_chain in your HTTP kernel (app/Http/Kernel.php) or, on Laravel 11+, in bootstrap/app.php via $middleware->alias([...]).src/Attributes/NextForwarded.php – the new attribute that declares the next message/handler in a chain.src/Middleware/ForwardChainMiddleware.php – the middleware that reads the attribute and performs the forwarding.#[NextForwarded(NextMessage::class)], add the phd_pipeline.forward_chain middleware to the pipeline that processes that message, then dispatch the message as usual. The middleware will automatically forward to NextMessage after the current handler completes.#[NextForwarded(...)] on each message class. The middleware resolves the attribute at runtime, so you don’t need to hard-code forwarding logic in your handlers.phd_pipeline.forward_chain to the middleware list of the pipeline that handles your messages. Order matters: place it after any middleware that must run before forwarding (e.g. validation) and before middleware that should see the forwarded message.#[NextForwarded] attributes to fan-out to multiple next messages. Check the package source for whether it supports an array or repeated attributes.Pipeline facade fake or the package’s own test helpers (if provided) to assert that a given message forwards to the expected next class without running the entire chain.phd_pipeline.forward_chain at the point where forwarding should occur.phd_pipeline.forward_chain is the most common cause of “nothing happens”. Double-check Kernel.php or bootstrap/app.php and clear config cache (php artisan config:clear).A → B → A). The package may not detect cycles automatically; add a max-depth guard or ensure your chain is acyclic.#[NextForwarded] is likely intended for classes. Applying it to methods or properties will silently do nothing. Verify the attribute’s #[Attribute] target flags.php artisan config:clear and php artisan cache:clear in development.composer.json (^1.0) and review the upgrade guide for any pre-1.0 breaking changes if you were using a dev version.How can I help you explore Laravel packages today?