These advanced series are pure gold. Thank you very much for sharing this quality content with us!
4 жыл бұрын
absolute pure gold
@MrMacphist04 жыл бұрын
thanks for the video! Although passing down "$request" to the pipes might be confusing, because it is actually a Builder instance. Hence, your abstract Filter class might be better understood like this: use Illuminate\Database\Eloquent\Builder; abstract class Filter { public function handle(Builder $builder, \Closure $next) { if (! request()->has($this->filterName())) { return $next($builder); } return $next($this->applyFilter($builder)); } abstract protected function applyFilter($builder); protected function filterName() { // ... } }
@MahmoudMohsab3 жыл бұрын
I gave him disliked for that, I couldn't handle it 🥺
@orangecode19025 жыл бұрын
Not a single effort of yours will go in vain. You will be rewarded for your pain. Your hard work will bring you a lot of gain.You are a Gift from God :-)
@CodersTape5 жыл бұрын
Appreciate it
@mouhcinemahfoud5 жыл бұрын
Usually I don't comment on KZbin, this video deserves a an excellent mark. Looking forward for next advanced things.
@sargolic3 жыл бұрын
This serie is precious, I wish I could give more than one like. Thx🙏🏻
@Vinothvipin5 жыл бұрын
Nowadays i am writing a clean code because of this channel , keep doing your great work. ;)
@kgsint10 ай бұрын
Thank you. I am learning a lot from this channel. Hope you are doing well.
@swish12345678908 ай бұрын
Love the videos, thank you! Love the pace and how you skip the simple stuff
@rifatspk4 жыл бұрын
You are the boss of Laravel and PHP. You made Laravel easy to me. Thanks.
@mouhamaddiop11444 жыл бұрын
Your videos are real diamonds. God bless you
@CodersTape4 жыл бұрын
Thank you.
@sofian-_-72 жыл бұрын
Man... you are the best. Where have you been? Please, come back 💗💗💗💗💗
@michaeldeeming46433 жыл бұрын
I've nearly finished all of the Laravel Advanced series. Keep up the good work Coder's Tape you provide really good content and also use a lot of real world problems which is helpful.
@amirp34875 жыл бұрын
I instantly subscribed to your channel when I saw one of your advanced laravel courses you are my second favorite after jeffrey way
@lincolnmunene5543 жыл бұрын
Pure content 🎉
@kennyray16404 жыл бұрын
Today I watched again, and coded along. I wanted to comment that the pace of this video is really fast, which is great for watching, but wow is it hard to keep up when coding along! 😁 But that's why there's a pause button, right? Again, thanks for a great tutorial - I love this pattern, and plan to use it going forward!
@manzadey4 жыл бұрын
Thank you for an easy and clear explanation of such a complex topic! Health to you, friend!
@ericapalosaari15535 жыл бұрын
Yet another awesome video! This will help me reduce a lot of code I've done on a project. Why didn't I notice this before now? :D
@mohammadrobihtz34855 жыл бұрын
Before watch this I always create method for each filter in the same class, and today I learned new thing. Thanks man!
@CodersTape5 жыл бұрын
It's all about learning techniques and adding tools to your development skills. Doesn't mean you'll use them every day but when it's perfect when the code calls for it.
@mohammadrobihtz34855 жыл бұрын
@@CodersTape Yeah, at least I know new techniques that I can use if needed.
@JohnDoe-ji1zv4 жыл бұрын
Really decent stuff 👍🏻 majority creating useless crud, thank you for really useful lesson 👍🏻👍🏻👍🏻
@al-mootasembellah91855 жыл бұрын
Watching this series is absolute satisafaction! Great work!
@tousifrafat2 жыл бұрын
This was amazing. A very powerful technique. Really liked it.
@chhirag Жыл бұрын
I love this concept. Thanks for the amazing video, will definitely look into the whole series. !!
@rogerramjet694 жыл бұрын
Bro I saw your first L6 today and WOW, what a presenter you are, cant wait to see more... SUBSCRIBED :)
@RickyBien5 жыл бұрын
your tutorials are very smooth! awesome!
@aghyadaljllad19923 жыл бұрын
amazing, using in all my projects
@juhavehnia78624 жыл бұрын
Great video! Hopefully we get more advanced laravel soon!
@edforrest98265 жыл бұрын
Whoop! Another one! Can't wait to learn from it :)
@ehsansoleimanian32263 жыл бұрын
really helpful like a goldmine.So impressive explanation
@stormcorexz5 жыл бұрын
awesome video thanks, the advanced topics videos are exactly what i need, and i guess not only me are interested in it.
@yurabobrov67175 жыл бұрын
Absolutely amazing as always! We are need more so perfect series!
@alia.dhillon62244 жыл бұрын
To include all the filter in the pagination links you can also use this "$posts->withQueryString()->links()".
@sulaimangari27455 жыл бұрын
Awesome, keep up the tutorial series sir, very much appreciated.
@anthonykianreyes35834 жыл бұрын
I really appreciate this kind of advance tutorials. Thankyou sir!
@lysun835 жыл бұрын
I think pipelines are more functional programing than oop because you use transformer function along the pipe, better if pure. If you keep the same object after crossing a transformer you may have very hard to debug issue.
@Mrxr00t4 жыл бұрын
great tutorial. Pipelines are one of the best laravel hidden feature when it comes to handle sequential process. In my opinion pipeline is not the good use case for filtering the data, maybe using query objects make more sense . Keep the good work
@walidbagh5 жыл бұрын
As always, the best of the best... Thank you!
@lfnkf5 жыл бұрын
Great approach to the topic. Got my subscription :)
@nikossts54774 жыл бұрын
This can be used inside a view()->composer to make it visible in any view you want to display it. Thanks a lot man you are really great.
@codewithsub50835 жыл бұрын
Waiting for this kind of stuff from a long time and noooooow, here it is!
@jamesbhatta4 жыл бұрын
Exactly what I want since very long time.
@larrylague13593 жыл бұрын
your a good teacher
@mdnamussakib80772 жыл бұрын
Great video series, thanks a lot for your hard work.
@togacentral4 жыл бұрын
You're amaizing teacher bro. very interesting info
@tihouatimohamedlamine20305 жыл бұрын
Amazing ! i'm new here and i really like your tutorials , explained very well !
@khlewe65 жыл бұрын
You are amazing👏👏 , I can't wait until the next video
@nguyenngocthuong51234 жыл бұрын
i saw 6 articles, although my English is pretty bad, but your instructions are easy to understand, thanks
@ProgrammingwithPeter5 жыл бұрын
Great explanations!
@kennyray16404 жыл бұрын
Wow. This was SO good! Thank you!
@amidesfahani7414 жыл бұрын
I did the same exact thing but I ran to this Error: BadMethodCallException Call to undefined method App\Models\Category::active() my model is "Category" in "Models" directory :((
@vincentomondi48815 жыл бұрын
Awesome content ... thank you very much for sharing these.
@bartomiejsobieszek4325 жыл бұрын
I have mixed feelings, while its something I didn't know, I don't feel its production ready state of art. There are model scopes which works much better than this so the given example is a bit misused. If this is not a part of documentation then probably it changes with minor versions of Laravel. Not sure when I would need these pipelines instead of performing method chaining pattern
@CodersTape5 жыл бұрын
I certainly understand and respect where you’re coming from. It’s another tool in your developer tool belt.
@ProgrammingwithPeter5 жыл бұрын
Of course, you are right, but knowledge is power and it's good to have multiple options when developing a feature
@SuperBatiskaf4 жыл бұрын
Agree with you, these filters are similar to local scopes, with no ability to parametrize the filter like dynamic scopes. How to allow, for example the sortBy=[lname,fname]&sortOrder=desc with pipeline idea? You can pass the closure instead of Sort::class, and you are losing the DI for the Sort constructor - right? But with dynamic scope you can do it such way: public function scopeSortBy($query, $field = 'fname', $order = 'asc') { return $query->orderBy($field, $order); } public function scopeActive($query, $active = 1) { return $query->where('active', $active); } And the usage: User::active()->sortBy()->sortBy('lname')->get(); But pipeline definitely useful idea for mass operations.
@IsaiahGamers4 жыл бұрын
Welcome to programming where there are always multiple ways of doing something.
@mansaha92885 жыл бұрын
Your style is internationally friendly! I hope you will add video about vendor and I guess you will say something like “why dont we become a vendor” after an intro like 4:28
@supram941g54 жыл бұрын
Thanks for the video. Using request() in pipeline for query.. never do this in real life
@renwar4 жыл бұрын
Dude, you are insane.
@imtiazahmed24754 жыл бұрын
Thats what I am looking in my unconditional mind :D
@adam1920215 жыл бұрын
The BEST as always!
@lysokkong58265 жыл бұрын
Wow It is so good.
@davudsafarli53565 жыл бұрын
Thank you. That was really useful
@jesseyvanofferen3495 жыл бұрын
Whenever I'd create something alike, I always keep things very ordered. Since you worked with the filters for the pipelines, and it could easily be something used in a lot of sections of the application because of the implementation, wouldn't it be even slightly more amazing if you wouldn't need to manually attach all pipes to it? But create your own array of pipes in the kernel which you could call and it would automatically apply all of them? Since you have a few basic pipes that are likely always available like the order, max / limit etc those could be always attached and any custom filters you'd have to apply manually.
@CodersTape5 жыл бұрын
That’s the beauty of pipes, just a lot of ways to automate it like you said and tons of reusable small classes.
@loukiidris70333 жыл бұрын
The best explain thanks a lot
@Zach28255 жыл бұрын
Oh man I wish I knew about these sooner!
@principe.borodin5 жыл бұрын
Awesome, but I already see query filter without pipelines, directly in model.
@JigneshJoisar5 жыл бұрын
Awesome,laravel deep in dive ..(concept)
@mamdouhzaq5 жыл бұрын
Awesome 👏
@15MrPablo4 жыл бұрын
thanks for that, your content is great!
@houiderwalid58423 жыл бұрын
you're so generous.
@myatkyawthu861 Жыл бұрын
Thank you
@nanchitacr4 жыл бұрын
Great video! I have a question the query I want to convert to this method is quite a bit more complex then just the examples you provided above, mine has relationships and also a different whereHas for each filter, how can I implement that? How can I do this on a post route?
@chaokang74215 жыл бұрын
非常有帮助 thx a lot
@rhiox77052 жыл бұрын
in the version with no pipelines, instead of asking if request has certain parameter, you could have use ->when() in query builder, and inside that call to an scope for filtering for actives/inactives, i am right? Great content btw!!!
@xdEdgarBest Жыл бұрын
You rock! 💪
@NathanBudd5 жыл бұрын
Great episode!! How would you go about adding a filter that isn't just =. eg, where age >= 15?
@Paltibenlaish3 жыл бұрын
awesome,
@Paulus19065 жыл бұрын
great tut but... you should think about parameters mapping e.g max_count you expect to be equal a number but what if i type max_count=sdasd? another thing is request()->has('active') returns true when in query string we have domain.com?active=&sort=desc
@CodersTape5 жыл бұрын
Absolutely. The next step would be to create a protection layer for things like that and also maybe a section to set some defaults.
@manojkumar-ki9pu5 жыл бұрын
Hi Sir... Your Tutorials are very helpful... and very much conceptual thank so mach.. :})
@robbradley13375 жыл бұрын
Nice video as usual. Please turn off parameter name hints in PHPStorm. They are super annoying. lol :D
@CodersTape5 жыл бұрын
I love the parameter hints! :)
@nullishcoalesce5 жыл бұрын
thanks
@Paltibenlaish3 жыл бұрын
amazing
@kareemkhalfalla87353 жыл бұрын
I just think about it just like switch statement :))
@mattskelton74713 жыл бұрын
Isn't the `handle` function actually accepting a builder object as the the first arg? At 17:20 you have it as though it is accepting a `$request` object.
@professionalcode7373 жыл бұрын
is this the way that laravel using in Scopes (local scope or global scope )
@mohammedabdelmoniem88093 жыл бұрын
it's really good but I was confused what is the difference between pipeline and model scope
@nano123133 жыл бұрын
Nice practice i like it, thank you so much i appreciate your efforts , i have an open question to everybody how can we validate these params active and sort ? many thanks in advance
@billmaragos28124 жыл бұрын
Hey man, this video is awesome, however I'm running into two errors that I don't understand. If I put the Pipeline code inside a static function in the Model (like you do at 24:59), and call that function in the Controller, then I get an error (Invalid argument supplied for foreach()), striking my @foreach ($posts as $post) in my view. However if I go back and place the code in the controller, it works fine. Also, I get another error when I'm trying to use the pagination links in the view {{ $events->appends(request()->input())->links() }} Edit on this one: I need to actually paginate the results in order for this error to go away. Any chance you can help ? I can provide any additional info.
@sojuthomas77274 жыл бұрын
*GOLD*
@shekhsaifuddin13535 жыл бұрын
You are just awesome
@thewizardguy13373 жыл бұрын
I wonder instead of making a bunch of different class names that match the DB model, you could by default "allow" sorting/filtering by a $sortable property on the model, and use $fillable as a fallback even 🤔
@degagnemarc4 жыл бұрын
Very nice way to get filters on a spesific model! Thanks for the tut! How would you approch getting the same filters, but in this case with a relational model? Ex.: posts and comments, you want all post title but sorted on authors name. And even push it to get post acs and authors asc Thanks for your tuts. You helped me a lot!
@Paltibenlaish4 жыл бұрын
wowwww
@EmadHa3 жыл бұрын
It's a good introduction to Pipelines but i really think the posts filtering idea pipelines isn't the best idea as it adds a lot of code and logic.
@CreepToeJoe4 жыл бұрын
I understood the concept and, as always, I'm trying to take it on the next level. Can you give me a hint on where/how to queue in the validation process? My guess would be to start in the Active and Sort classes - if validation passes, return your expression, if not - return an unmodified builder. EDIT: I just put it in the controller using the $request->validate([]) method. But it automatically redirects back if the validation fails and I can't really visualize the errors on the page.
@programmingmindset4 жыл бұрын
at first check whether your validation request is getting any kind of error not.
@CreepToeJoe4 жыл бұрын
I managed to get it working just the way I wanted. I will dig deeper into the error messages though...
@Lironesamoun3 жыл бұрын
How to use this pipeline pattern with Livewire as we don't have access to the request object ?
@RustineDave5 жыл бұрын
Awesome! Just to ask, is your vuejs course completely done?
@CodersTape5 жыл бұрын
It is for now, I will keep adding more real world examples as time goes by.
@RustineDave5 жыл бұрын
Oh so, it's safe for me to jump right into it now and technically saying, "Finish the series"? I see what you tryna do is like what you did to your laravel series, it was completely done(i guess) but you add more and more stuffs overtime.. Thanks
@CodersTape5 жыл бұрын
@@RustineDave Exactly. It's at a good "end" stage but questions arise and I try to answer those in a new lesson.
@mohamedhabib31894 жыл бұрын
it's very good but i think filter name not must be class name you can use protected $filterName="sort";
@adityashrivastava81105 жыл бұрын
Best teacher :) but i want to know how to change url test.pipelines or other
@CodersTape5 жыл бұрын
Laravel Valet
@davidsaint88665 жыл бұрын
Hi quick question...what's the first parameter in the handle function. It says $request but I feel it actually represents the querybuilder...
@CodersTape5 жыл бұрын
It is. You can rename it to $query or anything else.
@jmmmas4 жыл бұрын
Bad things in model: now model have dependency - request. If we want to use it in CLI - we can't. If it will be a note about that - it will be great.
@Ryu538984 жыл бұрын
That’s a job for scope
@faiyazrahman28144 жыл бұрын
How can I use this in a project without using the URL? I want to use this same action with a button. Like I wanna make all the posts ascending then what I have to do?
@geoAriton5 жыл бұрын
Bro, you need more props. Please consider doing some live stuff.
@free2idol12 жыл бұрын
28:52 anyone knows why $next($request) returns a Builder instance?