PP = Pipeline Pattern
Today, we will learn the Pipeline Pattern and how to use it in Laravel. You can read in depth about PP at HERE. PP can be ...
For further actions, you may consider blocking this person and/or reporting abuse
Another approach for this example is:
in PostController
in Post model
Your approach is specific for only post model. And above Pipeline example in tutorial can be used in multiple contollers.
you can make a trait and use it in each model you want
Nice abstractions.
I Loved it, it's will be so much useful for dynamic repetition too
Certainly pipelines are nice. But in this example they are ruined by having to create two separate modules to implement the filters, rather then to just do it inline.
I think you missed the post conclusion. Any here it is.
It might feel overwhelm to implement Pipelines just for two filters but it will be much clean and beneficial for large number of filter or any other complex implementation.
Example here is just for basic understanding of Pipeline. I won't be implement Pipeline for just two filters.
thankyou for teaching me with the most easiest and simple example
Glad you learn.
I think this is a good approach to code reuse for those about filtering by a common field in tables.
Thanks for the input!!
I usually use Traits for some filters, but your Pipelines pattern is more clear and that is good approach if we have many filters. Big thanks
Enjoy
I love it :)