Laravel 6 Advanced - e2 - View Composers

  Рет қаралды 69,512

Coder's Tape

Coder's Tape

Күн бұрын

View Composers come in very handy for "automatically" attaching data to views. This allows you to pull in views without worrying about proving the necessary data to make it work. Let's explore an example of it using the idea of Channels.
For the best experience, follow along in our interactive school at www.coderstape...
Documentation
laravel.com/do...
DigitalOcean Referral
m.do.co/c/7dce...
Hit us up on Twitter with any questions or comments @codertape ( / coderstape )
About This Course
Ready to level up your Laravel skills? This series is for you, follow along as we uncover the advanced Laravel features that actually make Laravel the most popular php framework. We'll have lot of tips and tricks along the way. Are you ready?

Пікірлер: 143
@daviddeleon3411
@daviddeleon3411 5 жыл бұрын
For those who wants Sir Victor to create a Shopping Cart Series and other stuffs... Sir Victor no need to create it for us. You guys need to watch his Laravel Tutorial and you can create it by doing the same logic of the tutorial he provided for us. Because now honestly, I already created my very first project which is Karaoke Reservation System and 50% of my learning is coming from sir Victor and others is just my self study thing. I am saying this because I am very thankful for my "Electronic Teacher" Sir Victor! THANK YOU SO MUCH!!!
@jedbonheur4073
@jedbonheur4073 4 жыл бұрын
i thought i knew laravel .......... never have i ever seen i guy who explain things like you !!! Good job
@henokfekade5740
@henokfekade5740 4 жыл бұрын
The best thing i like about you is, you use your time efficiently. Also you don't west any time. And you show me how to learn Laravel. Thank you.
@Dipenparmar12
@Dipenparmar12 4 жыл бұрын
Great. You are not teaching us just concepts. Most of time we get more extra information and methods how to use it.. appreciative,. Thank you....
@jayreigning
@jayreigning 4 жыл бұрын
Dude your explanation are so simple and easy to follow… you have a way to keep people interested and stick around longer, I am a self taught programmer, I have watched lots and lots of tutorials but most of the time after 10 min into the videos I am more or less bored or something but yours keeps me there until the end I am so enjoying this series . Keep up the good work :)
@vahidabedi9534
@vahidabedi9534 3 жыл бұрын
REALLY the most practical laravel channel
@Rizki0907
@Rizki0907 5 жыл бұрын
The partials part is very helpful. I've been subscribe to this channel long time ago, but I just realized this is the best channel for Laravel Tutorial. Thanks for making this channel.
@KeyserEngelberthAbarca
@KeyserEngelberthAbarca 5 жыл бұрын
Best explanation on Laravel View Composer i've seen so far. Gr8 job Victor! and as you said is a very delicate tool, but on the right logic makes miracles!!
@md.imrulhasan8757
@md.imrulhasan8757 4 жыл бұрын
I am watching this playlist in Laravel 8. Really amazed by these videos.
@AsifHassanran
@AsifHassanran 5 жыл бұрын
I personally prefer to keep the partials as low as possible, as an example I would not keep the tag in the partial rather I would include the partial inside a tag itself as my select tag's class,name,id etc may defer through out the application
@ramicchik3152
@ramicchik3152 Жыл бұрын
These tutorials are better than paid ones. Keep it up 👍
@rubenrafamercado2792
@rubenrafamercado2792 3 жыл бұрын
Hi Coder. Excellent your job here. I would like to have the automatic subtitles enabled. It can be very useful for people learning English too. "Gracias" from Argentine.
@jessieaguiao
@jessieaguiao 5 жыл бұрын
one of the best if not the best laravel youtube channel. period.
@JohnSmith-zl8rz
@JohnSmith-zl8rz 4 жыл бұрын
Best online teacher, no doubt! thank you!
@omiorangsha665
@omiorangsha665 5 жыл бұрын
if you made laravel shopping cart tutorial it will be very helpfull. I like your tutorial becouse it's very clean and real and effective.
@leeadams3147
@leeadams3147 3 жыл бұрын
Looking at this tutorial in 2021 quite a lot of the methods used have since changed. Creating Factories looks to be different now. I could be wrong but I experienced errors when trying to do this as instructed. I followed guidance from a more recent tutorial and had better success. Not to take anything away from this course, it's still very useful but understandably outdated at this point.
@rolandocruzvarona4030
@rolandocruzvarona4030 5 жыл бұрын
The best explanation I've seen about this topic so far, you rock!
@nurkenspashev
@nurkenspashev 5 жыл бұрын
Victor, thank you so much for the lessons.
@walidbagh
@walidbagh 5 жыл бұрын
The quality of this channel ... It makes me smile and subscribe :D
@jojienel1691
@jojienel1691 5 жыл бұрын
Sir Victor thank you for the crystal clear laravel / programming lesson
@AnoopD2013
@AnoopD2013 5 жыл бұрын
Thank you So Much for this wonderful series ....... hope you will go through Artisan and Packages :) . Once more thank you again .
@VadimBesedin
@VadimBesedin 4 жыл бұрын
Great teaching style! Happy to learn from you. Thank you!
@codingstuff8305
@codingstuff8305 5 жыл бұрын
Hi Victor. I've got a little tip for you. If you want to create a migration, factory and controller with a model you just have to put the - a flag on your artisan command. For example php artisan make:model Channel -a
@CodersTape
@CodersTape 5 жыл бұрын
Awesome. Thanks for sharing.
@aaBeben
@aaBeben 3 жыл бұрын
Wow amazing explanation, super bro! love and thanks from Jakarta, Indonesia.
@faizanrehman4209
@faizanrehman4209 5 жыл бұрын
Thank you so much victor, you are awesome. Please make a tutorial on CHAT Application, using laravel, vue, web-socket, pusher etc or whatever which is necessary
@producdevity
@producdevity 5 жыл бұрын
I’m loving these advanced series! Will there be more advanced video’s in the future or is this just a one time experiment?
@pietrosavastano9940
@pietrosavastano9940 3 жыл бұрын
Victor the living LEGEND
@hamidcoolboy
@hamidcoolboy 4 жыл бұрын
Great explanation. You should have more views and subscribers.
@jayparmar7959
@jayparmar7959 4 жыл бұрын
Very clear explanation and Thanks for tips!!
@purpleFluke
@purpleFluke 4 жыл бұрын
God bless you sir...the tutorial was straight to the point like a hot sauce
@Намбаванинзеворлд
@Намбаванинзеворлд 4 жыл бұрын
You are the best laravel youtuber!)
@bushraw66
@bushraw66 Жыл бұрын
exactly what I'm looking for, thank you so much
@ronburgandyesquire7480
@ronburgandyesquire7480 5 жыл бұрын
tip of the fedora to sir victor.... thank you. learning so much
@mulualemabate3193
@mulualemabate3193 4 жыл бұрын
Thanks sir, it was very helpful. It was clear and easy to understand the way you do things. Keep it up. Subscribed!
@mustafadundarcelebi1974
@mustafadundarcelebi1974 4 жыл бұрын
I like your tutorial becouse it's very clean and real and effective. thank you so much
@rjfortis5415
@rjfortis5415 5 жыл бұрын
You are Awesome, Victor! Your code is beautiful, it's poetry.
@antonionorato6900
@antonionorato6900 4 жыл бұрын
Thank you very much for this video and for the whole series
@erickzelaya3651
@erickzelaya3651 2 жыл бұрын
You are truly a master. Thanks for this amazing tuts
@kunwar_sagar
@kunwar_sagar 4 жыл бұрын
Thankyou for this awesome tutorial.
@nicolas.chauvet
@nicolas.chauvet 5 жыл бұрын
Clear as cristal. Thank you!
@ChrystopherMedina
@ChrystopherMedina 5 жыл бұрын
Hi Víctor! Great video. Could you share your Php storm config. I liked you theme.
@CodersTape
@CodersTape 5 жыл бұрын
It’s posted in my github repo.
@ChrystopherMedina
@ChrystopherMedina 5 жыл бұрын
@@CodersTape thanks Victor, keep doing this excelent videos. i learn a lot of them.
@m.sufianazeem5476
@m.sufianazeem5476 5 жыл бұрын
@@ChrystopherMedina do you have repo link? please share with me.
@jerryjeremy4038
@jerryjeremy4038 5 жыл бұрын
Amazing! I learn a lot even for creating simple dropdown page. Keep up the good work sir.
@MithileshJha_MCA
@MithileshJha_MCA 4 жыл бұрын
Awesome explanation
@pratikkumar1014
@pratikkumar1014 5 жыл бұрын
filling blessed to have you buddy
@TheZeroTrust
@TheZeroTrust 2 жыл бұрын
You saved my time Sir!
@najmeddinhaidar9641
@najmeddinhaidar9641 5 жыл бұрын
you make things much easier, Thank you for the greate tutorials
@mocharsdev
@mocharsdev 4 жыл бұрын
this help me a lot. thank you so much. subscribed.
@maabjavaid2403
@maabjavaid2403 5 жыл бұрын
Great Work,Great way of explanation i cant even have word to appreciate you. You make me to comment on this believe me i never ever comment on a video. not good great word keep it up bro
@CodersTape
@CodersTape 5 жыл бұрын
Thank you so much. Truly appreciate it
@davidhernandeze
@davidhernandeze 5 жыл бұрын
Great video, I really enjoy refactor as posible
@dgloria
@dgloria 4 жыл бұрын
I'm looking forward to find out how and where to do calculations and other alterations with data that comes from the database (multiple tables), and forward as a json to keep a clean controller file. I've got an idea that it happens using the model and resource files, but couldn't figure out how to manipulate joined data from multiple models.
@ashrafulfuad2967
@ashrafulfuad2967 4 жыл бұрын
nice explanation i have ever seen thank you sir
@claravelitapranolo3133
@claravelitapranolo3133 4 жыл бұрын
This is very helpful, Thank you so much
@soorajking2715
@soorajking2715 5 жыл бұрын
Great bro .......................
@fahadakhtar65
@fahadakhtar65 5 жыл бұрын
Wow laravel 6 with new music launched!
@delmontee
@delmontee 7 ай бұрын
This is great. But we now have Components as well as Partials. Which is better? Is there a benefit of one over the other (apart from the lovely syntax of Components)?
@jobsphil9553
@jobsphil9553 5 жыл бұрын
thanks for sharing tips . great tutorials.
@bartomiejsobieszek432
@bartomiejsobieszek432 5 жыл бұрын
Good video, but there are some cave eats. Last time I used a view composer (long time ago) it provided the data to every time a view has been used, but this is not the same as distinct views that you use. If you use some template a 100 times (let's say once per row in loop), then you will perform a 100 sql queries instead of one. This tool is only good as long as you are not using views inside the loops, unless they changed the internals so the data would be fetched once. The partials you created works the same as Laravel components, sometimes it work good, but I found it bit annoying to keep clean since the PHP logic may stack infinitely inside of them. Maybe this view composers can work well with a CQRS pattern, or at least a Query can benefit from it if planned well
4 жыл бұрын
Put the query in constructor and save result to a class property and than use this property in compose function. This way query will be fired only once.
@equals5StaR
@equals5StaR 4 жыл бұрын
If you include the same partial twice in a single view ( take some categories for example ) you would call the query 2 times ( every time the partial is composed ) which is not optimal.
@sebastianafadzie9072
@sebastianafadzie9072 4 жыл бұрын
Thank you very much this exactly what i've been searching for. Please i want to fetch multiple data from a database on one view, when ever i try to do that i get an error. i will be very glad if you can make a video on that.
@sntlln93
@sntlln93 5 жыл бұрын
I love your videos, keep it up. Greetings from Argentina.
@solteeme8745
@solteeme8745 5 жыл бұрын
That was way cool bro! So clear. Keep it up 👍👍
@alimransujon6388
@alimransujon6388 4 жыл бұрын
awesome explanation...
@pratikshrestha4712
@pratikshrestha4712 4 жыл бұрын
Love it man . Very Helpful
@forkanalam6530
@forkanalam6530 5 жыл бұрын
sir if you made a course laravel with react it will be helpful for us..your content are always best.
@CodersTape
@CodersTape 5 жыл бұрын
I don't know much about React, I won't be much help for you with React.
@inigofernandezgarcia
@inigofernandezgarcia 5 жыл бұрын
Hello, I love how you explain things. Can you do a Video of you Code-Editor Configuration? I love how you have it and I would like to have the same. At the moment I use Atom and I am not 100% convince. Thanks in Adv.
@ArunKumar-kb1bb
@ArunKumar-kb1bb 3 жыл бұрын
Very very helpful video.
@SmailPeche
@SmailPeche 4 жыл бұрын
that's way i love watching your videos, Big up
4 жыл бұрын
You should have put this query in to the constructor. This way you make sure it will be fetched only once.
@julianc8588
@julianc8588 4 жыл бұрын
Thanks! This was really helpfull!
@ermenagildo
@ermenagildo 4 жыл бұрын
cool stuff
@shekhsaifuddin1353
@shekhsaifuddin1353 2 жыл бұрын
It's been long time, we don't see you...😪
@LeopoldRamutsamaya
@LeopoldRamutsamaya 5 жыл бұрын
This is awesome man, much appreciated
@mayoryorma5048
@mayoryorma5048 4 жыл бұрын
Thank u man. God bless u.
@coderflex5818
@coderflex5818 4 жыл бұрын
Vert Great Tuts, Keep The Great work And thank you so much
@mohammadshahanshah8776
@mohammadshahanshah8776 5 жыл бұрын
HI, do we have any way to except the view from array of list of thousands of view as in option 2 or 3 or to except the view from all the view as in option 1 - share method. Because my intension is to pass data to all views except (or ignoring) one or few view
@CodersTape
@CodersTape 5 жыл бұрын
I don’t believe so but that’s a great idea for a PR. I’ll investigate this further.
@mohammadshahanshah8776
@mohammadshahanshah8776 5 жыл бұрын
@@CodersTape Thanks a lot, requesting you to please do that, thanks
@kurnia9406
@kurnia9406 3 жыл бұрын
better using view composer or facades when generate navbar for frontend?
@adam192021
@adam192021 5 жыл бұрын
The BEST as always!
@iShah300
@iShah300 3 жыл бұрын
Great series... One question (help) What if i want to insert a common field to every table lets say each table have a user_id as a foreign key so instead using user id in every insert function, i want it to be merged automatically to insert array.. . Thank you..
@sarder2008
@sarder2008 3 жыл бұрын
This is Super !!!
@sergentemel2513
@sergentemel2513 5 жыл бұрын
Very helpful video, thanks :)
@musamakhizar9403
@musamakhizar9403 3 жыл бұрын
I have a question if we breakdown to components and then apply this technique will this effect the performance of the application?
@alebuda117
@alebuda117 4 жыл бұрын
Amazing!!
@madtin
@madtin 5 жыл бұрын
Awesome content, subbed :)
@رضارحمتی-خ6ش
@رضارحمتی-خ6ش 4 жыл бұрын
thank you a lot very very usefull
@florenciodev3867
@florenciodev3867 2 жыл бұрын
Thank you
@SharkBait_ZA
@SharkBait_ZA 5 жыл бұрын
Awesome, thank you.
@golubovicm
@golubovicm 3 жыл бұрын
Why there is no interface ChannelCoposer has to implement in order to make sure that class has compose() method?
@sebastianafadzie9072
@sebastianafadzie9072 4 жыл бұрын
i don't know if you will understand me. For example on one page i want to show a user details together with all the list of the categories he has created. i really need this. i will be very happy if you can make that video.
@JohnSmith-zl8rz
@JohnSmith-zl8rz 4 жыл бұрын
11:20 which extension you use to the editor show you views: and callback: and all those thing that name the thing???? you know.
@JohnSmith-zl8rz
@JohnSmith-zl8rz 4 жыл бұрын
Why extension you use to show "views" "callbacks" etc. ?
@maksat607
@maksat607 2 жыл бұрын
You are the best
@rahulk6802
@rahulk6802 5 жыл бұрын
That's fantastic...
@acedecastro83
@acedecastro83 5 жыл бұрын
Thank you!
@tomek.z
@tomek.z 4 жыл бұрын
Thank you very much for all your tutorials. It's my #1 source for quality Laravel knowledge next to official docs. But one thing I can't figure out. What's the best way to arrange front and back of my application? Obviously the logic and all assets are different for each so creating resources for both in the same location is hard to maintain. So how it should be done? As for view composers I think good choice for that would be menu tree for my app which is present on all pages. Is it correct? But again it's used on all FRONT pages and only few in the back, that are used to manage my menu.
@CodersTape
@CodersTape 4 жыл бұрын
It's difficult to completely separate all front end logic from backend logic, they will just have to learn to live with some gray area of overlap. The only way is to build a single page app using 2 completely separate code bases.
@tomek.z
@tomek.z 4 жыл бұрын
@@CodersTape I'm not sure I presented my case clearly enough. I ment an app with admin panel. Front will be completely different for both (let's say react for my-app.com/admin, vue for main app my-app.com), all models mostly the same but controllers again different for main app and admin panel. I think it's not a good idea to put these in the same place because it will make a mess very quickly. So what's the best approach here? How to make it clean and efficient?
@aamishirfan3334
@aamishirfan3334 4 жыл бұрын
to solve that orderBy kind of issue what else we can do is like 1: create a method getChannels in your model 2: there call your method as return $this->all(); 3: now where ever you want to get all channels, create an instance of model and call that getChannels method. now if in future if you want any change like orderBy or what ever you can go straight to model class change it there and boom its changed everywhere.... how is this approach ??? u can do same with other crud function
@mr.milan.bhusal
@mr.milan.bhusal 5 жыл бұрын
can i start this ep from beginner level
@josephprosper6493
@josephprosper6493 5 жыл бұрын
Useful thanks
@zinebkhalis1854
@zinebkhalis1854 4 жыл бұрын
Thank you
@eslamabdallahabass5662
@eslamabdallahabass5662 Жыл бұрын
amazing
@tmdan91
@tmdan91 5 жыл бұрын
Thanks!
Laravel 6 Advanced - e3 - Polymorphic Relationships
21:33
Coder's Tape
Рет қаралды 75 М.
Laravel 6 Advanced - e1 - Service Container
23:27
Coder's Tape
Рет қаралды 274 М.
ДЕНЬ УЧИТЕЛЯ В ШКОЛЕ
01:00
SIDELNIKOVVV
Рет қаралды 3,5 МЛН
Laravel 6 Advanced - e7 - Repository Pattern
23:24
Coder's Tape
Рет қаралды 103 М.
Laravel 6 Advanced - e4 - Facades
24:33
Coder's Tape
Рет қаралды 61 М.
President Barack Obama: Between Two Ferns with Zach Galifianakis
6:37
Funny Or Die
Рет қаралды 47 МЛН
From Laravel Blade to Vue.js + API [Live-coding Example]
22:28
Laravel Daily
Рет қаралды 168 М.
Laravel 6 Advanced - e5 - Macros
19:04
Coder's Tape
Рет қаралды 34 М.
Keanu Reeves: Between Two Ferns with Zach Galifianakis | Netflix Is A Joke
4:33
GREATEST CHESS MOVE EVER PLAYED!!!!!
24:01
GothamChess
Рет қаралды 58 М.