No video

Laravel Eloquent: Deeper Relationships with One Query

  Рет қаралды 139,521

Laravel Daily

Laravel Daily

Күн бұрын

Пікірлер: 181
@chengkangzai
@chengkangzai 3 жыл бұрын
This will soon be the one of the most viewed video in this channel 😂 good work
@muditgulgulia5350
@muditgulgulia5350 3 жыл бұрын
Correct 😂
@aboodlibda7161
@aboodlibda7161 3 жыл бұрын
Yes I think ❤
@dibbyo456
@dibbyo456 2 жыл бұрын
Yup
@chengkangzai
@chengkangzai 2 жыл бұрын
Yes, it's me in 8 month, revisiting this video 😂
@tiagooliveira14
@tiagooliveira14 3 жыл бұрын
This packages should be in the framework. They're really good.
@LaravelDaily
@LaravelDaily 3 жыл бұрын
Anyone can add anything to the framework, it's open-source, so you can try.
@KgfLikia
@KgfLikia 2 жыл бұрын
Ι was about to say the same.
@user-zg1pc6md6y
@user-zg1pc6md6y 3 жыл бұрын
Большое спасибо) смотрю каждый день. Всегда очень полезно
@user-ld1gz1cr1j
@user-ld1gz1cr1j 3 жыл бұрын
Реал, не сложно говорит. Прекрасно понятно
@ARMONEY666
@ARMONEY666 3 жыл бұрын
Иногда такие вещи показывает что удивляешся
@pankajbokdia
@pankajbokdia 2 жыл бұрын
I cannot thank you enough! Your channel is AMAZING! Thank you for doing what you do!
@0x0456
@0x0456 Жыл бұрын
This is EXACTLY what I needed to see. Thank you so much!
@auroraapps1853
@auroraapps1853 Жыл бұрын
Superb Laravel specialized developer of all the time. I like you Sir
@philipcook6191
@philipcook6191 Жыл бұрын
Soon to by membership this month. Your way of explaining wastes no time and you to the point and so knowledgeable, been watching for year but I need to get into your full courses. Thanks for this, a super help. From cape town, south africa.
@worthsalive
@worthsalive Жыл бұрын
You just earned a new subscriber. Kudos to you. You just showed me exactly what I needed to see
@abdalkhalekchamkha3622
@abdalkhalekchamkha3622 Жыл бұрын
you are the best ,thanks you for improving my laravel knowledge, i was do stupid things before i see this video 😅
@levieraf
@levieraf 3 жыл бұрын
Dude! you are awesome, so so accurate! You are a good teacher! I love your channel! Great work!
@salman-804
@salman-804 2 жыл бұрын
I learnt a lot from this tutorial. Thanks a lot !!
@bilaljan7659
@bilaljan7659 Жыл бұрын
that is what i was searchingfor an hour, thanks alot sir !!!
@MahmodurRahmanShihab
@MahmodurRahmanShihab 3 жыл бұрын
Thanks for your laravel daily tips.
@DennisBraga
@DennisBraga 3 жыл бұрын
Life saving tip. Life saving package. Congrats to both.
@glowiever
@glowiever 2 жыл бұрын
finally the addon is mature enough to use! nice tutorial.
@AldhiAlbadri
@AldhiAlbadri 2 жыл бұрын
Problem solving, thanks sir!
@aineelzihnee9634
@aineelzihnee9634 3 жыл бұрын
First time seeing video on youtube without dislike button being tick.
@demeja16
@demeja16 3 жыл бұрын
Очень крутое видео, спасибо за улучшение наших знаний в Laravel:)
@maxgoose4671
@maxgoose4671 3 жыл бұрын
ну я хз понял ли он)
@shahosanandaji9894
@shahosanandaji9894 Жыл бұрын
You are the best, Povilas!
@ChangeYourLifeForever
@ChangeYourLifeForever 2 жыл бұрын
by this video you can understand the principle of has_many and belongs_to in other languages and frameworks also
@msdeav
@msdeav 3 жыл бұрын
Really helpful video. Thank you
@ValeriyaPolovinkina
@ValeriyaPolovinkina 2 жыл бұрын
Thank you for this video. In real life we need in one query some fields from first level, some from second level, third, etc. But it is another story =)
@HadiHasanpur
@HadiHasanpur Жыл бұрын
Many thanks You are best in yours job ... I cannot thank you enough! Thank you teacher for your trainings!
@KasimSheyi
@KasimSheyi 3 жыл бұрын
Your videos are always wonderful.
@vigneswarans13
@vigneswarans13 6 ай бұрын
Excellent explanation 🎉
@arashpirhadi1326
@arashpirhadi1326 3 жыл бұрын
great video thanks. :) but i think in some situation like this performance will drop after 2 joins and more. I mostly using DB facade for retrieving data from database.
@LaravelDaily
@LaravelDaily 3 жыл бұрын
Yes, for complex queries raw queries are still the best.
@azeroth5672
@azeroth5672 3 жыл бұрын
This is what I need!!! Thankyou so muchh for this
@user-rm4zo1mg5o
@user-rm4zo1mg5o 3 жыл бұрын
Something done with few lines I have to do with complex sql queries with joins, to do the same on old projects running over laravel 5.2 in my main work. Thank for this video.
@hamzaradouan4074
@hamzaradouan4074 3 жыл бұрын
I literally needed to know this, thank you so much 💓 keep up the great work 💪
@shaadishtiaque2084
@shaadishtiaque2084 3 жыл бұрын
Your tutorials help a lot... Thanks
@AlexTheGreatish
@AlexTheGreatish 3 жыл бұрын
This is great thank you.. Could you do a video explaining the different type of relationships and how the database structures should be set up in terms of where foreign keys are, etc?
@LaravelDaily
@LaravelDaily 3 жыл бұрын
I have an article: blog.quickadminpanel.com/eloquent-relationships-the-ultimate-guide/ Also, it's best to read the docs: laravel.com/docs/8.x/eloquent-relationships
@biplobshaha2829
@biplobshaha2829 Жыл бұрын
Thank you so much. It's help me a lot.💝💝
@Dinookys
@Dinookys Жыл бұрын
🎉 save the day, thanks a lot
@jeanfrancois3605
@jeanfrancois3605 3 жыл бұрын
OMG, this is amazing thank you so much!
@vbadheli
@vbadheli 3 жыл бұрын
Thank you.. this help me a lot..
@JamesShisiah
@JamesShisiah 2 жыл бұрын
This is really great. Love it
@Trizen321
@Trizen321 2 жыл бұрын
you always provide good content
@md.robelahammed4763
@md.robelahammed4763 Жыл бұрын
Amazing content. It helps me a lot. Thanks
@Matheus708
@Matheus708 Жыл бұрын
Wow! that`s really really awesome!
@alexandergontsov6219
@alexandergontsov6219 Жыл бұрын
Really good job. Thanks 🙏
@bmtamim7818
@bmtamim7818 3 жыл бұрын
You are awesome 😍
@afestacincome2224
@afestacincome2224 3 жыл бұрын
Can you please do a Short video on how to create nested comment and also a Short video on how to retweet a post ( Just like Twitter)
@ikarahubs965
@ikarahubs965 3 жыл бұрын
Retweet feature will be nice
@niffeydovie4906
@niffeydovie4906 3 жыл бұрын
@@ikarahubs965 nested comment please
@cethartest469
@cethartest469 3 жыл бұрын
awesome, thanks you, please more and more advanced eloquent
@LaravelDaily
@LaravelDaily 3 жыл бұрын
I have a full course about advanced eloquent: laraveldaily.teachable.com/p/laravel-eloquent-expert-level
@MUJAHIDKHAN
@MUJAHIDKHAN 3 жыл бұрын
Thank sir , one of the best video
@hostname47
@hostname47 2 жыл бұрын
very very very helpful package thanks !
@codepilot2766
@codepilot2766 3 жыл бұрын
This is awesome bro......It will help me a lot :)
@nbqenglishvietsubstyle117
@nbqenglishvietsubstyle117 3 жыл бұрын
You are a god to me, thank you so so much
@kreatur_
@kreatur_ 3 жыл бұрын
Great, now I just need to know how to access deeper relationships with a girl
@lucasj.pereira4912
@lucasj.pereira4912 3 жыл бұрын
To talk with her dad or grandad?
@6BEEP9
@6BEEP9 3 жыл бұрын
You would be fine with just BelongsTo
@Raftor74
@Raftor74 3 жыл бұрын
Awesome!
@poplach
@poplach 3 жыл бұрын
Very informative video, thanks.
@amrqawasmeh
@amrqawasmeh Жыл бұрын
Thx for the great content
@QianZhiwei
@QianZhiwei Жыл бұрын
very well. thank you.
@aryarizkysandi8351
@aryarizkysandi8351 2 жыл бұрын
thank you very much for tutorial sir!!
@g3n1kindra
@g3n1kindra 2 жыл бұрын
this help me a lot, thanks
@AbdulMajeedShehzad
@AbdulMajeedShehzad 3 жыл бұрын
Thank you for the great video, I've a question for this scenario. is it a good practice to use keys in deep relations ? for example in employees table we add country_id to avoid complex queries when working on reporting. I've been looking for this answer for quite a long time
@kauandouglas
@kauandouglas 2 жыл бұрын
Up
@javieru5871
@javieru5871 2 жыл бұрын
Feel you bro, done the same: usign foreign keys to those deep deep relationships
@tarekalhalabi8776
@tarekalhalabi8776 3 жыл бұрын
Great video💙
@newtonsefa5721
@newtonsefa5721 11 ай бұрын
Thank you
@fylzero
@fylzero 3 жыл бұрын
The BelongsToThrough query actually became less efficient, no? It reduced the queries and models used but memory and time to execute increased.
@gethermedel3620
@gethermedel3620 2 жыл бұрын
exactly, it slowed it down but it did simplify the work, so if you're application doesn't require or need the small performance difference, it's a good choice though.
@programadorweb8403
@programadorweb8403 Жыл бұрын
good work!!!
@claudiomenares4172
@claudiomenares4172 5 ай бұрын
Muchas gracias 🤯
@insider-analyst
@insider-analyst 2 жыл бұрын
composer require staudenmeir/belongs-to-through:"^2.5" not installing on laravel 8
@joshbarros1995
@joshbarros1995 3 жыл бұрын
This is cool!!!
@Ayvengo21
@Ayvengo21 5 ай бұрын
All the time i see that orm magic like this I'm asking myself does it worth it or maybe some escaped sql would be way easier to read and write. Because sql knowledge could be transferred between projects while knowledge of specific orm might be problematic.
@ivan.silicin
@ivan.silicin 3 жыл бұрын
Thank you!
@my_religion
@my_religion 2 жыл бұрын
Pretty helpful!
@rdvr
@rdvr 3 жыл бұрын
Brilliant!
@amgadalwattar2863
@amgadalwattar2863 2 жыл бұрын
very helpfull thanks
@ahmedsyam
@ahmedsyam 3 жыл бұрын
Good job!
@rishabhandari2501
@rishabhandari2501 3 жыл бұрын
Helpful 🙌🖤
@erh4rdt
@erh4rdt 3 жыл бұрын
great, thank you!
@huynguyenduyit4441
@huynguyenduyit4441 Жыл бұрын
Amazing
@fuhfaysal
@fuhfaysal 2 жыл бұрын
awesome!!
@andriusgeciauskas3154
@andriusgeciauskas3154 5 ай бұрын
@Laravel Daily Sveikas Povilai, niekaip negaliu issaikinti turiu panasia problema: character->quests->objectives->tasks turiu padaryti toki dalyka paspaudus mygtuka "track quest" uzsitrakina questas kaip betkokiam zaidime sone atsiranda lentele kad zaidejas matytu questa kuri trackina. man reiketu duomenu is visus modeliu quest, objectives, tasks kurios pajungsiu ant laravel websockets kad kai zaidejas progresuoja per savo questa jie butu automatiskai updatinami. klausimas butu toks: ar tai butu imanoma padaryti su hasMany ar hasManyThrough ar belongsToMany niekaip negaliu isspresti sitos bedos reikia uzloadinti questus su objectives ir tasks
@LaravelDaily
@LaravelDaily 5 ай бұрын
Žinok trumpame komentare negaliu atsakyti, reikia žaistis ir eksperimentuoti, deja nebeturiu laiko tokiam individualiam konsultavimui. Bandyk rašyti į Laracasts forumą.
@mostafamahfouz1139
@mostafamahfouz1139 2 жыл бұрын
thanks a lot
@GabrielMoura32
@GabrielMoura32 2 жыл бұрын
thanks
@chibuikeumezinwa7827
@chibuikeumezinwa7827 3 жыл бұрын
Lovely!
@dApoTB
@dApoTB 3 жыл бұрын
Thanks for your videos! Could you please do one about constructing relationships between tables that are in different databases and connection names to those tables cannot be hard coded. E.g.: User table is in DB1, Post table is in DB2 and Comment table is in DB3. Can we construct a relationship here? Thanks!
@SonsParaRelaxar
@SonsParaRelaxar 3 жыл бұрын
It will work the same, the only thing you will have to do is overwrite the connection variable inside of the model.
@muditgulgulia5350
@muditgulgulia5350 3 жыл бұрын
Best video. 👌
@achmadimanfirmansyah663
@achmadimanfirmansyah663 3 жыл бұрын
thank you
@berthojoris
@berthojoris 3 жыл бұрын
The best....Thanks
@developer_sagor
@developer_sagor 3 жыл бұрын
thank you very much
@devsun9063
@devsun9063 3 жыл бұрын
Thanks 🙏
@sir_brian_d
@sir_brian_d 3 жыл бұрын
6:03 the query count went down but the time & memory usage went up, less performant 🤔maybe it is not using an index
@GergelyCsermely
@GergelyCsermely 3 жыл бұрын
Thanks
@jimishukurow2286
@jimishukurow2286 3 жыл бұрын
royal like from me!
@RANJEETKUMAR-wz4dg
@RANJEETKUMAR-wz4dg 3 жыл бұрын
amazing thanks
@TechITWorld
@TechITWorld 2 жыл бұрын
Could you make one video of belongstomany with three level deep query with where condition (with the last one)?
@erikgratz5539
@erikgratz5539 Жыл бұрын
@ 8:00 you are showing off the functionality of `hasManyDeep` to associate employees with their countries. Could this also be achieved with an additional `hasManyThrough` definition? Where it is defined as `hasManyThrough(Employee::class, Shop::class)` ? Or do those methods not chain well / is this strictly better for performance?
@ekselyum34
@ekselyum34 3 жыл бұрын
Thanks 👏
@ts.subramanipaiduthaly2038
@ts.subramanipaiduthaly2038 2 жыл бұрын
Bro, if possible all your future video please make very big fonts and alsp zoom abit because when we use phone its hard to see. It cause not complete watch
@akintandavid2500
@akintandavid2500 Жыл бұрын
Thanks for this how can i learn more about eager loading
@martinh4982
@martinh4982 3 жыл бұрын
Hi Povilas, In Eloquent is it possible to join to an arbitrary sql statement? For example, say I have a User model and I want to create a UserStats relationship. However UserStats is not a table, but a sql statement that computes stuff like last_login, number_of_posts, up_votes etc. The only way I've found to do this so far is with a database view that I manage with migrations, but was wondering if this could be done purely in Laravel.
@shofada
@shofada 3 жыл бұрын
Thanks or putting this together. If you had a page that needs to display say for every employee, the country, city and shop, what might the query look like?
@dacpuspadewi
@dacpuspadewi 3 жыл бұрын
Hey,, thankyou for this tutorial. and i have question related to this. so, i have 4 models which connect 4 tables : 1st model (dupak table): public function activities() { return $this->belongsToMany(Activity::class, 'activity_dupaks', 'dupak_id', 'activity_id'); } 2nd model (activities table): public function dupak() { return $this->belongsToMany(Dupak::class, 'activity_dupaks', 'activity_id', 'dupak_id'); } public function productionType() { return $this->belongsTo(ProductionType::class, 'production_type_id'); } 3rd model (production_types table): public function activities() { return $this->hasMany(Activity::class); } public function resultUnit() { return $this->belongsTo(ResultUnit::class, 'result_unit_id'); } 4th model (result_unit table): public function productionTypes() { return $this->hasMany(ProductionType::class); } the questions is, how to get data from result_unit table, from dupak table collection(->get()) ? i want to foreach the $dupaks = Dupak::where(....)->get(); in blade, and show some data from result_unit table through $dupaks foreach. i really clueless for this case. i hope you answer my question :') thankyou^^
@gloriaordiz5924
@gloriaordiz5924 Жыл бұрын
Please make a video about this package belongstothrough
@LaravelDaily
@LaravelDaily Жыл бұрын
That package has a very good documentation, not sure why the video is needed
@ugayashan8659
@ugayashan8659 3 жыл бұрын
Great content, can you make a video on user referral system using laravel Eloquent
@renwar
@renwar 3 жыл бұрын
Very helpful video. Why laravel framework does not have these kind of relationships yet?
@LaravelDaily
@LaravelDaily 3 жыл бұрын
You're free to submit pull requests to the framework and add it.
@johnerrolprincipe8992
@johnerrolprincipe8992 Жыл бұрын
Hi, I watched your video about function's return type, is there any documentation about the full list of return types? Thank you!
@LaravelDaily
@LaravelDaily Жыл бұрын
Any PHP variable type or PHP/Laravel class could be a return type. There's no list.
@vovkko
@vovkko 3 жыл бұрын
This all sounds good when you have less 1k records, but when you have 2m inner join with 14m table performance will die
@MrFxJ
@MrFxJ 3 жыл бұрын
Hmm what do you suggest? Because from my POV this is the best performance you will get and if you have 2m inner join with 14m table performance will die whatever you use
@martinjones8231
@martinjones8231 3 жыл бұрын
I follow all of your video u are great because the laravel path am on is just what u can teach so I need ur personal contact.
5 tips for supercharged Laravel Eloquent queries
16:29
Andrew Schmelyun
Рет қаралды 68 М.
Eloquent Performance: TOP 3 Mistakes Developers Make
7:59
Laravel Daily
Рет қаралды 48 М.
ОБЯЗАТЕЛЬНО СОВЕРШАЙТЕ ДОБРО!❤❤❤
00:45
Survive 100 Days In Nuclear Bunker, Win $500,000
32:21
MrBeast
Рет қаралды 161 МЛН
Challenge matching picture with Alfredo Larin family! 😁
00:21
BigSchool
Рет қаралды 41 МЛН
ПОМОГЛА НАЗЫВАЕТСЯ😂
00:20
Chapitosiki
Рет қаралды 28 МЛН
Laravel: Create Public API with Cache and Rate Limits
12:18
Laravel Daily
Рет қаралды 45 М.
Eloquent or Query Builder: When to Use Which?
5:48
Laravel Daily
Рет қаралды 87 М.
Laravel Octane: supercharge your Laravel applications
8:34
Aaron Francis
Рет қаралды 38 М.
SOLID Principles in Laravel: 5 Examples (+ New Course!)
21:07
Laravel Daily
Рет қаралды 72 М.
18 Laravel/PHP Tips in 10 Minutes: June 2024
10:41
Laravel Daily
Рет қаралды 9 М.
I tried 8 different Postgres ORMs
9:46
Beyond Fireship
Рет қаралды 404 М.
Top 5 Laravel "Bad Practices" (My Opinion)
10:32
Laravel Daily
Рет қаралды 20 М.
Brutally honest advice for new .NET Web Developers
7:19
Ed Andersen
Рет қаралды 145 М.
ОБЯЗАТЕЛЬНО СОВЕРШАЙТЕ ДОБРО!❤❤❤
00:45