No video

Laravel 6 Advanced - e6 - Pipelines

  Рет қаралды 52,342

Coder's Tape

Coder's Tape

Күн бұрын

Пікірлер: 152
@nero3700
@nero3700 5 жыл бұрын
These advanced series are pure gold. Thank you very much for sharing this quality content with us!
4 жыл бұрын
absolute pure gold
@MrMacphist0
@MrMacphist0 4 жыл бұрын
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() { // ... } }
@MahmoudMohsab
@MahmoudMohsab 3 жыл бұрын
I gave him disliked for that, I couldn't handle it 🥺
@orangecode1902
@orangecode1902 5 жыл бұрын
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 :-)
@CodersTape
@CodersTape 5 жыл бұрын
Appreciate it
@mouhcinemahfoud
@mouhcinemahfoud 5 жыл бұрын
Usually I don't comment on KZbin, this video deserves a an excellent mark. Looking forward for next advanced things.
@sargolic
@sargolic 3 жыл бұрын
This serie is precious, I wish I could give more than one like. Thx🙏🏻
@Vinothvipin
@Vinothvipin 5 жыл бұрын
Nowadays i am writing a clean code because of this channel , keep doing your great work. ;)
@kgsint
@kgsint 10 ай бұрын
Thank you. I am learning a lot from this channel. Hope you are doing well.
@swish1234567890
@swish1234567890 8 ай бұрын
Love the videos, thank you! Love the pace and how you skip the simple stuff
@rifatspk
@rifatspk 4 жыл бұрын
You are the boss of Laravel and PHP. You made Laravel easy to me. Thanks.
@mouhamaddiop1144
@mouhamaddiop1144 4 жыл бұрын
Your videos are real diamonds. God bless you
@CodersTape
@CodersTape 4 жыл бұрын
Thank you.
@sofian-_-7
@sofian-_-7 2 жыл бұрын
Man... you are the best. Where have you been? Please, come back 💗💗💗💗💗
@michaeldeeming4643
@michaeldeeming4643 3 жыл бұрын
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.
@amirp3487
@amirp3487 5 жыл бұрын
I instantly subscribed to your channel when I saw one of your advanced laravel courses you are my second favorite after jeffrey way
@lincolnmunene554
@lincolnmunene554 3 жыл бұрын
Pure content 🎉
@kennyray1640
@kennyray1640 4 жыл бұрын
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!
@manzadey
@manzadey 4 жыл бұрын
Thank you for an easy and clear explanation of such a complex topic! Health to you, friend!
@ericapalosaari1553
@ericapalosaari1553 5 жыл бұрын
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
@mohammadrobihtz3485
@mohammadrobihtz3485 5 жыл бұрын
Before watch this I always create method for each filter in the same class, and today I learned new thing. Thanks man!
@CodersTape
@CodersTape 5 жыл бұрын
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.
@mohammadrobihtz3485
@mohammadrobihtz3485 5 жыл бұрын
@@CodersTape Yeah, at least I know new techniques that I can use if needed.
@JohnDoe-ji1zv
@JohnDoe-ji1zv 4 жыл бұрын
Really decent stuff 👍🏻 majority creating useless crud, thank you for really useful lesson 👍🏻👍🏻👍🏻
@al-mootasembellah9185
@al-mootasembellah9185 5 жыл бұрын
Watching this series is absolute satisafaction! Great work!
@tousifrafat
@tousifrafat 2 жыл бұрын
This was amazing. A very powerful technique. Really liked it.
@chhirag
@chhirag Жыл бұрын
I love this concept. Thanks for the amazing video, will definitely look into the whole series. !!
@rogerramjet69
@rogerramjet69 4 жыл бұрын
Bro I saw your first L6 today and WOW, what a presenter you are, cant wait to see more... SUBSCRIBED :)
@RickyBien
@RickyBien 5 жыл бұрын
your tutorials are very smooth! awesome!
@aghyadaljllad1992
@aghyadaljllad1992 3 жыл бұрын
amazing, using in all my projects
@juhavehnia7862
@juhavehnia7862 4 жыл бұрын
Great video! Hopefully we get more advanced laravel soon!
@edforrest9826
@edforrest9826 5 жыл бұрын
Whoop! Another one! Can't wait to learn from it :)
@ehsansoleimanian3226
@ehsansoleimanian3226 3 жыл бұрын
really helpful like a goldmine.So impressive explanation
@stormcorexz
@stormcorexz 5 жыл бұрын
awesome video thanks, the advanced topics videos are exactly what i need, and i guess not only me are interested in it.
@yurabobrov6717
@yurabobrov6717 5 жыл бұрын
Absolutely amazing as always! We are need more so perfect series!
@alia.dhillon6224
@alia.dhillon6224 4 жыл бұрын
To include all the filter in the pagination links you can also use this "$posts->withQueryString()->links()".
@sulaimangari2745
@sulaimangari2745 5 жыл бұрын
Awesome, keep up the tutorial series sir, very much appreciated.
@anthonykianreyes3583
@anthonykianreyes3583 4 жыл бұрын
I really appreciate this kind of advance tutorials. Thankyou sir!
@lysun83
@lysun83 5 жыл бұрын
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.
@Mrxr00t
@Mrxr00t 4 жыл бұрын
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
@walidbagh
@walidbagh 5 жыл бұрын
As always, the best of the best... Thank you!
@lfnkf
@lfnkf 5 жыл бұрын
Great approach to the topic. Got my subscription :)
@nikossts5477
@nikossts5477 4 жыл бұрын
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.
@codewithsub5083
@codewithsub5083 5 жыл бұрын
Waiting for this kind of stuff from a long time and noooooow, here it is!
@jamesbhatta
@jamesbhatta 4 жыл бұрын
Exactly what I want since very long time.
@larrylague1359
@larrylague1359 3 жыл бұрын
your a good teacher
@mdnamussakib8077
@mdnamussakib8077 2 жыл бұрын
Great video series, thanks a lot for your hard work.
@togacentral
@togacentral 4 жыл бұрын
You're amaizing teacher bro. very interesting info
@tihouatimohamedlamine2030
@tihouatimohamedlamine2030 5 жыл бұрын
Amazing ! i'm new here and i really like your tutorials , explained very well !
@khlewe6
@khlewe6 5 жыл бұрын
You are amazing👏👏 , I can't wait until the next video
@nguyenngocthuong5123
@nguyenngocthuong5123 4 жыл бұрын
i saw 6 articles, although my English is pretty bad, but your instructions are easy to understand, thanks
@ProgrammingwithPeter
@ProgrammingwithPeter 5 жыл бұрын
Great explanations!
@kennyray1640
@kennyray1640 4 жыл бұрын
Wow. This was SO good! Thank you!
@amidesfahani741
@amidesfahani741 4 жыл бұрын
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 :((
@vincentomondi4881
@vincentomondi4881 5 жыл бұрын
Awesome content ... thank you very much for sharing these.
@bartomiejsobieszek432
@bartomiejsobieszek432 5 жыл бұрын
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
@CodersTape
@CodersTape 5 жыл бұрын
I certainly understand and respect where you’re coming from. It’s another tool in your developer tool belt.
@ProgrammingwithPeter
@ProgrammingwithPeter 5 жыл бұрын
Of course, you are right, but knowledge is power and it's good to have multiple options when developing a feature
@SuperBatiskaf
@SuperBatiskaf 4 жыл бұрын
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.
@IsaiahGamers
@IsaiahGamers 4 жыл бұрын
Welcome to programming where there are always multiple ways of doing something.
@mansaha9288
@mansaha9288 5 жыл бұрын
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
@supram941g5
@supram941g5 4 жыл бұрын
Thanks for the video. Using request() in pipeline for query.. never do this in real life
@renwar
@renwar 4 жыл бұрын
Dude, you are insane.
@imtiazahmed2475
@imtiazahmed2475 4 жыл бұрын
Thats what I am looking in my unconditional mind :D
@adam192021
@adam192021 5 жыл бұрын
The BEST as always!
@lysokkong5826
@lysokkong5826 5 жыл бұрын
Wow It is so good.
@davudsafarli5356
@davudsafarli5356 5 жыл бұрын
Thank you. That was really useful
@jesseyvanofferen349
@jesseyvanofferen349 5 жыл бұрын
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.
@CodersTape
@CodersTape 5 жыл бұрын
That’s the beauty of pipes, just a lot of ways to automate it like you said and tons of reusable small classes.
@loukiidris7033
@loukiidris7033 3 жыл бұрын
The best explain thanks a lot
@Zach2825
@Zach2825 5 жыл бұрын
Oh man I wish I knew about these sooner!
@principe.borodin
@principe.borodin 5 жыл бұрын
Awesome, but I already see query filter without pipelines, directly in model.
@JigneshJoisar
@JigneshJoisar 5 жыл бұрын
Awesome,laravel deep in dive ..(concept)
@mamdouhzaq
@mamdouhzaq 5 жыл бұрын
Awesome 👏
@15MrPablo
@15MrPablo 4 жыл бұрын
thanks for that, your content is great!
@houiderwalid5842
@houiderwalid5842 3 жыл бұрын
you're so generous.
@myatkyawthu861
@myatkyawthu861 Жыл бұрын
Thank you
@nanchitacr
@nanchitacr 4 жыл бұрын
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?
@chaokang7421
@chaokang7421 5 жыл бұрын
非常有帮助 thx a lot
@rhiox7705
@rhiox7705 2 жыл бұрын
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
@xdEdgarBest Жыл бұрын
You rock! 💪
@NathanBudd
@NathanBudd 5 жыл бұрын
Great episode!! How would you go about adding a filter that isn't just =. eg, where age >= 15?
@Paltibenlaish
@Paltibenlaish 3 жыл бұрын
awesome,
@Paulus1906
@Paulus1906 5 жыл бұрын
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
@CodersTape
@CodersTape 5 жыл бұрын
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-ki9pu
@manojkumar-ki9pu 5 жыл бұрын
Hi Sir... Your Tutorials are very helpful... and very much conceptual thank so mach.. :})
@robbradley1337
@robbradley1337 5 жыл бұрын
Nice video as usual. Please turn off parameter name hints in PHPStorm. They are super annoying. lol :D
@CodersTape
@CodersTape 5 жыл бұрын
I love the parameter hints! :)
@nullishcoalesce
@nullishcoalesce 5 жыл бұрын
thanks
@Paltibenlaish
@Paltibenlaish 3 жыл бұрын
amazing
@kareemkhalfalla8735
@kareemkhalfalla8735 3 жыл бұрын
I just think about it just like switch statement :))
@mattskelton7471
@mattskelton7471 3 жыл бұрын
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.
@professionalcode737
@professionalcode737 3 жыл бұрын
is this the way that laravel using in Scopes (local scope or global scope )
@mohammedabdelmoniem8809
@mohammedabdelmoniem8809 3 жыл бұрын
it's really good but I was confused what is the difference between pipeline and model scope
@nano12313
@nano12313 3 жыл бұрын
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
@billmaragos2812
@billmaragos2812 4 жыл бұрын
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.
@sojuthomas7727
@sojuthomas7727 4 жыл бұрын
*GOLD*
@shekhsaifuddin1353
@shekhsaifuddin1353 5 жыл бұрын
You are just awesome
@thewizardguy1337
@thewizardguy1337 3 жыл бұрын
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 🤔
@degagnemarc
@degagnemarc 4 жыл бұрын
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!
@Paltibenlaish
@Paltibenlaish 4 жыл бұрын
wowwww
@EmadHa
@EmadHa 3 жыл бұрын
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.
@CreepToeJoe
@CreepToeJoe 4 жыл бұрын
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.
@programmingmindset
@programmingmindset 4 жыл бұрын
at first check whether your validation request is getting any kind of error not.
@CreepToeJoe
@CreepToeJoe 4 жыл бұрын
I managed to get it working just the way I wanted. I will dig deeper into the error messages though...
@Lironesamoun
@Lironesamoun 3 жыл бұрын
How to use this pipeline pattern with Livewire as we don't have access to the request object ?
@RustineDave
@RustineDave 5 жыл бұрын
Awesome! Just to ask, is your vuejs course completely done?
@CodersTape
@CodersTape 5 жыл бұрын
It is for now, I will keep adding more real world examples as time goes by.
@RustineDave
@RustineDave 5 жыл бұрын
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
@CodersTape
@CodersTape 5 жыл бұрын
@@RustineDave Exactly. It's at a good "end" stage but questions arise and I try to answer those in a new lesson.
@mohamedhabib3189
@mohamedhabib3189 4 жыл бұрын
it's very good but i think filter name not must be class name you can use protected $filterName="sort";
@adityashrivastava8110
@adityashrivastava8110 5 жыл бұрын
Best teacher :) but i want to know how to change url test.pipelines or other
@CodersTape
@CodersTape 5 жыл бұрын
Laravel Valet
@davidsaint8866
@davidsaint8866 5 жыл бұрын
Hi quick question...what's the first parameter in the handle function. It says $request but I feel it actually represents the querybuilder...
@CodersTape
@CodersTape 5 жыл бұрын
It is. You can rename it to $query or anything else.
@jmmmas
@jmmmas 4 жыл бұрын
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.
@Ryu53898
@Ryu53898 4 жыл бұрын
That’s a job for scope
@faiyazrahman2814
@faiyazrahman2814 4 жыл бұрын
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?
@geoAriton
@geoAriton 5 жыл бұрын
Bro, you need more props. Please consider doing some live stuff.
@free2idol1
@free2idol1 2 жыл бұрын
28:52 anyone knows why $next($request) returns a Builder instance?
Laravel 6 Advanced - e7 - Repository Pattern
23:24
Coder's Tape
Рет қаралды 103 М.
Laravel 6 Advanced - e8 - Lazy Collections & PHP Generator
20:28
Coder's Tape
Рет қаралды 35 М.
Bony Just Wants To Take A Shower #animation
00:10
GREEN MAX
Рет қаралды 7 МЛН
Joker can't swim!#joker #shorts
00:46
Untitled Joker
Рет қаралды 39 МЛН
OMG what happened??😳 filaretiki family✨ #social
01:00
Filaretiki
Рет қаралды 12 МЛН
Enums considered harmful
9:23
Matt Pocock
Рет қаралды 203 М.
Laravel 6 Advanced - e3 - Polymorphic Relationships
21:33
Coder's Tape
Рет қаралды 75 М.
Laravel 6 Advanced - e1 - Service Container
23:27
Coder's Tape
Рет қаралды 273 М.
DHH discusses SQLite (and Stoicism)
54:00
Aaron Francis
Рет қаралды 59 М.
Laravel 6 Advanced - e4 - Facades
24:33
Coder's Tape
Рет қаралды 61 М.
Laravel 6 Advanced - e9 - Soft Deletes
12:17
Coder's Tape
Рет қаралды 25 М.
The Greenwich Meridian is in the wrong place
25:07
Stand-up Maths
Рет қаралды 793 М.
The Logging Everyone Should Be Using in .NET
15:34
Nick Chapsas
Рет қаралды 59 М.