No video

Laravel Blade Foreach: 3 "Tricks" You May Not Know

  Рет қаралды 59,647

Laravel Daily

Laravel Daily

Күн бұрын

Today I'll show you how to add conditions inside of rows in @foreach and how to shorten it into a one-liner.
The $loop variable: laravel.com/do...
Foreach vs Forelse: dev.to/pratham...
@each command: laravel-news.c...
If you're interested in the Livewire part of this project, go here: livewirekit.com
- - - - -
Try our Laravel QuickAdminPanel: bit.ly/quickad...
Enroll in my Laravel courses: laraveldaily.t...

Пікірлер: 126
@bhuvi1007
@bhuvi1007 3 жыл бұрын
I'm watching this at 1AM while in bed,now my brain is forcing me to get up and refactor all the views. Great content.
@EL_PANDA_742
@EL_PANDA_742 2 жыл бұрын
Me too 😂
@filmku1232
@filmku1232 2 жыл бұрын
LoL😂
@arianaromero9552
@arianaromero9552 3 жыл бұрын
I don't speak english (I speak spanish), but I understand all, Laravel is amazing and you are a excellent teacher, the best. I've learning more with you that in the university.
@mehrdaddadashi124
@mehrdaddadashi124 2 жыл бұрын
hi , I watch your videos every morning and then continue my laravel projects .thanks for good English pronunciation , because I'm from Iran and I realize so quickly🙏
@Edvard-Aliev
@Edvard-Aliev 3 жыл бұрын
Вы просто пулемет! Не поспеваю за вами! Спасибо за каждое ваше видео!
@SinghatehAlagie
@SinghatehAlagie 3 жыл бұрын
Laravel is great 👍 when you read the documentation very carefully, you will understand most of the logics and thank you for the great content sir. We appreciate your content.
@nabeelyousafpasha
@nabeelyousafpasha 3 жыл бұрын
Love your methodology to explain all things present in actual documentation. Respect from Pakistan
@leslysuarez9686
@leslysuarez9686 2 жыл бұрын
wow, Povilas, you really are a good teacher. In these minutes of video I have learned more than in any 4-hour course and of course it is about blade, but for what I knew this is another level. Thanks. 🧡
@janjanssens6967
@janjanssens6967 3 жыл бұрын
I'm just started refactoring some sections from a big project i'm working on. This video just arrived at the right time for me. 😁 This is going to be amazing! Thanks!! 👍
@sergeysaharov5750
@sergeysaharov5750 3 жыл бұрын
Thank you for the very useful video! It's important to know that @each has no $loop-variable
@BsiennKhan
@BsiennKhan 3 жыл бұрын
Why didn't I knew this before. "Seems I don't read documentation as much I should :P" Great video Thanks
@salmanifrahim3245
@salmanifrahim3245 2 жыл бұрын
loved each msec
@gram_o_phone
@gram_o_phone 3 жыл бұрын
I often found myself doing iteration with regular php instead of blade because the lack of comparing and other functions. Now it seems much more handy! Thanks, great content!
@codeology1
@codeology1 3 жыл бұрын
You are the master of Laravel Tricks in short videos 👍
@ndeblauw
@ndeblauw 3 жыл бұрын
One of the better ones! Good content, extremely good pedagogical strategy. Thanks!
@LaravelDaily
@LaravelDaily 3 жыл бұрын
Glad you liked it!
@OpuHasnatopqclick
@OpuHasnatopqclick 2 жыл бұрын
A very handy feature. Thanks!
@AlmutasimAlmazidi
@AlmutasimAlmazidi 3 жыл бұрын
Laravel is great and you're awesome. You're an excellent instructor that I have seen in programming
@rifkimadhani
@rifkimadhani Жыл бұрын
It helps me a lot, thankyou so much.
@shubhamsahuSD
@shubhamsahuSD 2 жыл бұрын
Thanks for saving life, remaining was useful
@krashnpalsingh9118
@krashnpalsingh9118 Жыл бұрын
Awesome explanation
@fulufheloful
@fulufheloful 3 жыл бұрын
That's a really good tip i didn't know about the loop
@dk81
@dk81 3 жыл бұрын
Learned new thing.. Laravel blade @each. Thank you!
@roleenboticario435
@roleenboticario435 2 жыл бұрын
Thansk for this! great job bro.
@pushpenbanerjee9625
@pushpenbanerjee9625 2 жыл бұрын
Thank You Sir. Love You
@82bda
@82bda 3 жыл бұрын
Thank you! It`s awesome!
@joaocagnoni1
@joaocagnoni1 3 жыл бұрын
Thank you for the video
@Slada1
@Slada1 3 жыл бұрын
Thank you very much!
@JouvaMoufette
@JouvaMoufette 3 жыл бұрын
I knew about $loop. I knew about @forelse. I totally didn't know about @else which is very nice!
@azizullahsamim9924
@azizullahsamim9924 3 жыл бұрын
Thank you for the great description.
@MustafaBirsoz
@MustafaBirsoz 3 жыл бұрын
That each directive. Wow
@403gtfo
@403gtfo 3 жыл бұрын
Very smart. I’m loving livewire
@TechnoBlogTales
@TechnoBlogTales 3 жыл бұрын
very helpful Thanks
@alexshamoev2643
@alexshamoev2643 3 жыл бұрын
Thank you!
@bboydarknesz
@bboydarknesz 2 жыл бұрын
this is amazing!
@development2301
@development2301 Жыл бұрын
Great work
@debjit21
@debjit21 3 жыл бұрын
Love the tutorial it's awesome.
@pataslocas4595
@pataslocas4595 2 жыл бұрын
thanks you so much!!!
@cethartest469
@cethartest469 3 жыл бұрын
you is AWESOME like laravel
@isaacrobot
@isaacrobot 3 жыл бұрын
thanks for sharing these! although I wouldn't necessarily use all of these since I personally think that the one line final code is not readable at all
@DanielŚmigiela
@DanielŚmigiela 3 жыл бұрын
you are the best!
@iamriwash7943
@iamriwash7943 3 жыл бұрын
o that's amazing I always use if condition. this is so help full
@romanthemrb
@romanthemrb 3 жыл бұрын
That's really great 🤩 before I didn't know about it.
@sumonchandrashil8406
@sumonchandrashil8406 3 жыл бұрын
Thanks guru.
@IngenieroJorgeIvan
@IngenieroJorgeIvan 2 жыл бұрын
Espectacular! Muchas gracias Sensei.
@tamratteshome2001
@tamratteshome2001 Жыл бұрын
Really amazing!! I would have started your courses if I had had the chance of online payment from my country.😥😥😥 (what I can do is subscribe your channel and I did it.)
@sryamazaki
@sryamazaki 2 жыл бұрын
Great. Thanks
@Atiradeonvideo
@Atiradeonvideo 3 жыл бұрын
Brilliant.
@teknolojiuzmaniburada
@teknolojiuzmaniburada 3 жыл бұрын
Thats like a miracle! Thanks a lot 😊
@chuchober
@chuchober 3 жыл бұрын
Thank you very much. This is magic!
@amitmandaviya
@amitmandaviya 3 жыл бұрын
Thanks for the amazing tricks.
@Diego-eb9we
@Diego-eb9we 2 жыл бұрын
I noticed that when a page has a lot of includes it affects the page load speed by the browser
@DimaSimonishvili
@DimaSimonishvili 3 жыл бұрын
Great video, thanks. Somehow I didn't know about @each directive :P
@shaikhfoysal4426
@shaikhfoysal4426 3 жыл бұрын
Nice Thanks a lot.
@eigennspace
@eigennspace 2 жыл бұрын
SO MUCH THANK YOU SIR, :'D
@dedyalamsyah7086
@dedyalamsyah7086 3 жыл бұрын
Awesome ... may i request .. laravel with odata 🙏🏿
@developerahtnezev507
@developerahtnezev507 Жыл бұрын
Wow! it's perfect +10
@rodvillass
@rodvillass 3 жыл бұрын
Great video, no dislikes on this one too 😛
@olusolaojewunmi1995
@olusolaojewunmi1995 3 жыл бұрын
This is just awesome.
@kerolesmonsef4179
@kerolesmonsef4179 3 жыл бұрын
wow , this is great
@Akhzar1000
@Akhzar1000 3 жыл бұрын
The @each can come in handy.
@Fenrir-Wolf
@Fenrir-Wolf 3 жыл бұрын
Jak zawsze wspaniałe 👍🙂
@rsvtech367
@rsvtech367 3 жыл бұрын
Thank you sir, foreach different type showing.
@pavankumar-of4ew
@pavankumar-of4ew 2 жыл бұрын
Can u show how to display the multiple fields
@SanjayKumar-un7xf
@SanjayKumar-un7xf 3 жыл бұрын
Awesome!
@DungHoangTri
@DungHoangTri 3 жыл бұрын
Thanks for your sharing. @each directive is nice but it's not so useful because it can't inherit other variables from the parent view as mentioned on Laravel Document website.
@user-jy8zn5kh1f
@user-jy8zn5kh1f Ай бұрын
it should inhert and there should be a way to pass a variable to @each directive. not sure why there don't allow it
@matejcerny4459
@matejcerny4459 3 жыл бұрын
Thank you so much!
@vicsystems
@vicsystems 3 жыл бұрын
Wao I learnt alot
@samhk2222
@samhk2222 3 жыл бұрын
Didn't know about each!
@ilyasayusuf5447
@ilyasayusuf5447 3 жыл бұрын
Which one do you think is better ? Blade or js framework like react, vue or next ?
@user-jy8zn5kh1f
@user-jy8zn5kh1f Ай бұрын
How to pass a variable to @each directive sir? Is it possible?
@JunteJunae
@JunteJunae 3 жыл бұрын
I have data of about 100,000 records that are sitting on a datatable that i need to speed up. any Ideas of what i can do t have it load faster.
@duongval
@duongval 2 жыл бұрын
I learn new @each
@mukhtarhussain2659
@mukhtarhussain2659 3 жыл бұрын
amazing
@7stackstudio
@7stackstudio 3 жыл бұрын
Thankd for this 👏👌
@nishantgupta1854
@nishantgupta1854 3 жыл бұрын
Great
@khoerulumam8316
@khoerulumam8316 3 жыл бұрын
Its a great!
@beatnu187
@beatnu187 3 жыл бұрын
Is it possible to create an video on how to create a filter with livewire for a products page? Thanks in advance!
@PovilasKorop
@PovilasKorop 3 жыл бұрын
It will be a part of my upcoming livewirekit.com, launching this week if nothing goes wrong
@beatnu187
@beatnu187 3 жыл бұрын
@@PovilasKorop thank you, i look forward to it.
@mrfresshness
@mrfresshness 3 жыл бұрын
Please tut on livewire for the table you just used
@PovilasKorop
@PovilasKorop 3 жыл бұрын
It will be a part of my upcoming livewirekit.com - for now, you can subscribe there to get notified when it's launched
@leonvanrijswijk8409
@leonvanrijswijk8409 3 жыл бұрын
Thanks. I think signed url would be a good idea for a video
@PovilasKorop
@PovilasKorop 3 жыл бұрын
In my opinion, Signed URLs have a pretty narrow use case, not sure it would be very useful for the majority of the audience here. But thanks for the suggestion!
@josibee
@josibee 3 жыл бұрын
@@PovilasKorop the use case isn't that much because majority of developers don't know how to use it. It will be great if you cover it also. May I also express my gratitude for the quality contents you share and your support to the community.
@PovilasKorop
@PovilasKorop 3 жыл бұрын
@@josibee Yes I agree, but I have 50+ items in my list of content to create, so I prioritize based on the value for MAJORITY on this channel, mostly.
@josibee
@josibee 3 жыл бұрын
@@PovilasKorop well understood. We could have it in the future. I look forward to the 50+ amazing contents. You're the real champ!
@wimfpz4517
@wimfpz4517 3 жыл бұрын
how do i merge more than one foreach value in 1 row?
@aliyubabayo440
@aliyubabayo440 3 жыл бұрын
Hi, do you think jetstream should include table and table elements as components? Thanks.
@LaravelDaily
@LaravelDaily 3 жыл бұрын
Jetstream has components only for the elements that are actually used in Jetstream. I haven't seen a table in Jetstream, so no need for the component.
@GergelyCsermely
@GergelyCsermely 3 жыл бұрын
Thanx
@egzonmurati8364
@egzonmurati8364 Жыл бұрын
How to create foreach parellel in Laravel
@dadomultimediamusic
@dadomultimediamusic 3 жыл бұрын
Thank you so much for sharing. I have a question, how it could be possible to include an extra variable with @each, because the template that I´m building, needs that second variable too. Thank you.
@jeffrey44
@jeffrey44 2 жыл бұрын
What about using an array?
@dadomultimediamusic
@dadomultimediamusic 2 жыл бұрын
@@jeffrey44 Yes, I agree, but where? and how? Greetings :)
@MiguelBonifaz
@MiguelBonifaz 3 жыл бұрын
Excelente 👍
@ivan.silicin
@ivan.silicin 3 жыл бұрын
Круто, спасибо!
@imperialelectronicsjm
@imperialelectronicsjm 3 жыл бұрын
Hey if have a project already built with laravel 6 or 7 can livewire be install?
@vokalout
@vokalout 3 жыл бұрын
Thanks for this video. Never knew about the @each method until now. Also, what would you recommend one do to prepare for a 1hr technical interview? Are they mostly coding or answering/defining terms?
@PovilasKorop
@PovilasKorop 3 жыл бұрын
There's no "standard" here, every interview is very individual for the company/position/project you go for. You just answer with what you know, and if you don't know, you just say you don't know, or you ask a minute to figure it out and then google the answer.
@ashifulislam
@ashifulislam 3 жыл бұрын
wow.
@baliflorent6971
@baliflorent6971 Жыл бұрын
Please sir, which theme do you use for your editor ?
@LaravelDaily
@LaravelDaily Жыл бұрын
Material darker in phpstorm
@L-A-O-S
@L-A-O-S 3 жыл бұрын
wow
@guilhermemoraes4055
@guilhermemoraes4055 3 жыл бұрын
Do you have any course about this same project you showed in the video? Idk anything about livewire yet but it looks amazing!
@PovilasKorop
@PovilasKorop 3 жыл бұрын
It will be a part of the upcoming livewirekit.com set of components, should be launched this week.
@guilhermemoraes4055
@guilhermemoraes4055 3 жыл бұрын
Perfect! Thanks a lot. Btw, I just found your tweet from last year about 7 free Laravel courses. By any chance can I get that yet?
@PovilasKorop
@PovilasKorop 3 жыл бұрын
@@guilhermemoraes4055 Not sure which tweet you mean, but probably that promotion was a very long time ago, currently I don't offer free courses, sorry.
@jayantrawat5961
@jayantrawat5961 3 жыл бұрын
How to use $loop variable while using each, as we can do inside foreach?
@PovilasKorop
@PovilasKorop 3 жыл бұрын
I don't think it's possible.
@jayantrawat5961
@jayantrawat5961 3 жыл бұрын
@@PovilasKorop okay thanks. That's clear then when to use it or when to not. Although that's a great video.
@LSNED-d4y
@LSNED-d4y 3 жыл бұрын
How to prevent foreach from repeating the same data or values?
@nhj4000
@nhj4000 3 жыл бұрын
Can I use foreach with an array instead an object?
@LaravelDaily
@LaravelDaily 3 жыл бұрын
Yes
@nhj4000
@nhj4000 3 жыл бұрын
@@LaravelDaily I have the next error: Attempt to read property "Name" on bool. It only happens when i try to use foreach, when i put just the variable by itself it runs ok
@RaicaBogdan
@RaicaBogdan 2 жыл бұрын
Well I'll be damned :) this I didn't knew!
@evgenn787
@evgenn787 Жыл бұрын
а как можно отсортировать результат что бы с последних айдишников показывались?
@calibroguy3247
@calibroguy3247 3 жыл бұрын
Laravel is becoming Ruby on Rails...
@vicsystems
@vicsystems 3 жыл бұрын
Wao @each()
@aymenopa3563
@aymenopa3563 3 жыл бұрын
when you said it in one line and won't be include i was thinking by removing "new lines"
@PratikKhanolkar
@PratikKhanolkar 3 жыл бұрын
And then he added include🤭. Though I agree that livewire helps a lot. Saved my days of work.
@rahulk6802
@rahulk6802 3 жыл бұрын
clap(100);
Junior Code Review: Laravel Routes, Middleware, Validation and more
19:57
9 Tips for Shorter Laravel Code
10:16
Laravel Daily
Рет қаралды 61 М.
Lehanga 🤣 #comedy #funny
00:31
Micky Makeover
Рет қаралды 30 МЛН
Eloquent Performance: TOP 3 Mistakes Developers Make
7:59
Laravel Daily
Рет қаралды 48 М.
Laravel Security: Top 7 Mistakes Developers Make
11:16
Laravel Daily
Рет қаралды 83 М.
Junior Code Review: Better Routes, CRUDs and Validation
17:58
Laravel Daily
Рет қаралды 59 М.
From Blank to Blog With Laravel in 10 Minutes
12:21
Laracasts
Рет қаралды 12 М.
5 tips for supercharged Laravel Eloquent queries
16:29
Andrew Schmelyun
Рет қаралды 68 М.
Exceptions in Laravel: Why/How to Use and Create Your Own
12:18
Laravel Daily
Рет қаралды 87 М.
4 Packages You Need in ANY Laravel Project
8:14
Laravel Daily
Рет қаралды 61 М.
Laravel Validation: 12 Less-Known Tips in 13 Minutes
13:11
Laravel Daily
Рет қаралды 38 М.