Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Jeff Ochoa:
Understanding Laravel Pipelines
Aug 29, 2017 @ 10:59:36

On his Medium blog Jeff Ochoa has written up a tutorial that want to help you understand pipelines in Laravel, a fluid interface that can be used to pass objects around.

Basically, using laravel pipelines you can pass an object between several classes in a fluid way to perform any type of task and finally return the resulting value once all the “tasks” have been executed.

[...] The most clear example about how pipelines works resides in one of the most used components of the framework itself. I’m talking about middlewares.

He uses a simple middleware as an example, covering how they're just "pipes" in the pipeline of execution. He includes a snippet of code from the Illuminate handling showing its place in the pipeline and gives a more real world example of commenting functionality with a few different pieces of functionality. He shows how this could be refactored into the pipeline handling and what happens at the end of the pipe.

tagged: laravel pipeline introduction tutorial pipe example

Link: https://medium.com/@jeffochoa/understanding-laravel-pipelines-a7191f75c351