I would never use it, because of the next reasons. 1. Very complicated to test, since pipeline is more a helper method. 2. Violates open/closed principle. As you mentioned 'if somebody wants to add new pipeline' - he would have to touch the original file that calls these pipes, instead of working in separate class. 3. Not the best OOP solution, since link between pipes and a calling class is a helper. I'd stick to a small stand alone class like 'set of rules' or 'set of actions', which I would call from controller or whatever other class. That solution is clear OOP, with easy testing and doesn't violate open/closed principle. I don't see any advantage with pipelines, unless you're a big fan chaining methods. Not testable = not best to use.
I never heard of this before but I like it. I kinda want to try it out for building custom filters for data. Each filter the user turns on adds it to the pipeline, then I just run the piepline. I feel that like would be 1000x cleaner than constant uses of `where()` in a giant query builder instance.
I have never used this in five years of Laravel, but it might be useful in very specific cases. I can think of a few projects I’ve done that could have benefited from this.
The Pipeline is a general definition that is used in most fields, Laravel uses a Pipeline especially in middleware. The middleware is built on this awesome definition to make the request passes through every middleware in order way then return the final result.
Interesting, I have a large publishing method which has a lot of sub routines for things like preparing assets, creating backups, zipping files and deploying to remote servers, all based on various configurations. Breaking it down using pipes and external classes makes so much more sense.
This Feature is really Good, still having confused to understand it. Audience need some solid implementation by you. I hope you will share the practical example that how and where its useful
Is good to implement the "Chain of Responsabilities" Pattern. I would use it to handle some situation where I'm not sure a priori wich strategy is the best. For example, to determine "location" information, I can use DB if user is logged, Cookies if there is some, HTTP headers if there's information, or IP address.
I have heard this pipeline but as far I know PHP is a synchronous language that run line by line. So I don't see how's pipeline benefits the process. Can someone explain?
Don’t consider it as a performance feature. I see it rather as an architectural pattern which helps you under certain circumstances to organize your code ore cleanly.
I would never use it, because of the next reasons.
1. Very complicated to test, since pipeline is more a helper method.
2. Violates open/closed principle. As you mentioned 'if somebody wants to add new pipeline' - he would have to touch the original file that calls these pipes, instead of working in separate class.
3. Not the best OOP solution, since link between pipes and a calling class is a helper.
I'd stick to a small stand alone class like 'set of rules' or 'set of actions', which I would call from controller or whatever other class. That solution is clear OOP, with easy testing and doesn't violate open/closed principle.
I don't see any advantage with pipelines, unless you're a big fan chaining methods. Not testable = not best to use.
I used the pipeline to filtering the data and it is amazing.
I never heard of this before but I like it. I kinda want to try it out for building custom filters for data. Each filter the user turns on adds it to the pipeline, then I just run the piepline. I feel that like would be 1000x cleaner than constant uses of `where()` in a giant query builder instance.
Yes it pretty clean, but it unreadable, you must pass couple minutes the understand the conditions (scopes is the best solution).
The package named Tenancy for Laravel also uses pipelines. I kinda like this technique even though never used it.
I have never used this in five years of Laravel, but it might be useful in very specific cases. I can think of a few projects I’ve done that could have benefited from this.
The Pipeline is a general definition that is used in most fields, Laravel uses a Pipeline especially in middleware. The middleware is built on this awesome definition to make the request passes through every middleware in order way then return the final result.
Pipeline are great with iostreams, it let you describe how to modify each byte from the input to the output, it makes encryptions/compression easier
Interesting, I have a large publishing method which has a lot of sub routines for things like preparing assets, creating backups, zipping files and deploying to remote servers, all based on various configurations. Breaking it down using pipes and external classes makes so much more sense.
Great way to refactor of huge services and extract not only objects transformation, but queries if you have big amount of search parameters.
Thanks for mentioning me! 🙏
Awesome presentation and best channel for learn laravel..
always thanks for great content!!!
Very awesome feature, I make use of it whenever I don't want to use 'when' for record filtering. It helps to eliminate if and else statements
This Feature is really Good, still having confused to understand it. Audience need some solid implementation by you. I hope you will share the practical example that how and where its useful
Only got a high level understanding of the usage... Would like to go deeper to implement it...
Very interesting
Actually this is well known design pattern - chain responsibility. Just implementation throw Laravel contract
It's really good to know about Laravel pipelines.
Is good to implement the "Chain of Responsabilities" Pattern. I would use it to handle some situation where I'm not sure a priori wich strategy is the best. For example, to determine "location" information, I can use DB if user is logged, Cookies if there is some, HTTP headers if there's information, or IP address.
This video is amazing, the quality of the examples provided by the community provide different ways to use it, thanks great examples
Pipelines are not similar to event and providers?
No
Humm I have a app that used many of filters so this the time to change those filters to pipline classes 🙂🙂
sounds goods, but sir, help do your handon coding examples on it for better understanding
imm using Pipeline when im using search filter.
Interesting, i can see myself abusing it in my current project.
An /api route that returns HTML 😂
I have heard this pipeline but as far I know PHP is a synchronous language that run line by line. So I don't see how's pipeline benefits the process. Can someone explain?
Don’t consider it as a performance feature. I see it rather as an architectural pattern which helps you under certain circumstances to organize your code ore cleanly.
good😁😁
Thanks
Interesting