No video

Eloquent Many To Many Relationship | Laravel For Beginners | Learn Laravel

  Рет қаралды 23,849

Code With Dary

Code With Dary

Күн бұрын

Пікірлер: 45
@codewithdary
@codewithdary 2 жыл бұрын
LETS CONNECT THROUGH INSTAGRAM. www.Instagram.com/codewithdary
@shaquankelly6655
@shaquankelly6655 2 жыл бұрын
Followed this tutorial and I think it is great. One thing I will add though (took me a while to figure out what I was doing wrong) is that to access the relationship through an API/Controller you don't call it as a function but a relationship property. So instead of $pizza->ingredients(); it would be $pizza->ingredients; Just in case anyone Laravel newbies come across this in the future. Thanks for the tutorial!
@codewithdary
@codewithdary 2 жыл бұрын
Thanks for sharing bud!
@user-zm2dn8nn1u
@user-zm2dn8nn1u Жыл бұрын
Awesome sir u r live saver thanks from India
@dacpuspadewi
@dacpuspadewi 3 жыл бұрын
Hi Dary, thanks for the tutorial. and i want to ask some relation case. for example, 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 u answer my question :') thankyou^^
@ramiavrahami8709
@ramiavrahami8709 3 жыл бұрын
Dary, I think some additional part should be added which is talking about attach and sync functions. Great work !!
@codewithdary
@codewithdary 3 жыл бұрын
Thanks for the suggestion Rami!
@ttakaew1195
@ttakaew1195 Жыл бұрын
thank you for making it easy for me, i really dumb
@codewithdary
@codewithdary Жыл бұрын
No dumbs here, just a learning experience :)
@elkhanhamet2561
@elkhanhamet2561 3 жыл бұрын
thank you Dary, appreciate your hard work for us man!!!👍👍👍👏👏👏👏.Stay safe!!!
@codewithdary
@codewithdary 3 жыл бұрын
Thank you, I will Elkhan, you too!
@codewithdary
@codewithdary 3 жыл бұрын
@@carlmenger4964 No you are completely right Carl Menger. I kept your previous racist comment but I delete comments of people that are negative. That also has to do with race obviously...
@lauragriffiths3332
@lauragriffiths3332 3 жыл бұрын
This has helped me loads, thank you
@codewithdary
@codewithdary 3 жыл бұрын
Glad it helped
@MaartenKnolle
@MaartenKnolle 2 жыл бұрын
thank you very much. helped me a lot.
@codewithdary
@codewithdary 2 жыл бұрын
You're welcome!
@mr_presley
@mr_presley 2 жыл бұрын
This was a helpful video Thanks!
@codewithdary
@codewithdary 2 жыл бұрын
Glad it was helpful!
@odilurinkulov7489
@odilurinkulov7489 3 жыл бұрын
Thank you!!!
@codewithdary
@codewithdary 3 жыл бұрын
You are Welcome Odil!
@shafiu283
@shafiu283 3 жыл бұрын
Great work!!!
@codewithdary
@codewithdary 3 жыл бұрын
Thank you so much 😀
@linglingzhang8583
@linglingzhang8583 2 жыл бұрын
6:46, if i understood correct, may it should be like all the cars belong to many products, instead of " all the products belongs to specific car".
@TheWaqaspuri
@TheWaqaspuri Жыл бұрын
While making the function in Model, What is the rule for BelongsTo function e.g. will Changing product to product1 works?
@ezzygd2521
@ezzygd2521 Жыл бұрын
Don't know if you still reply, but is it safe to call delete on cascade in many to many relations? I still don't understand how that wouldn't result in, say, if you delete a car, then all the products related to it get deleted too? Or are we just deleting the connection in the pivot table in this case?
@SethSetiadha
@SethSetiadha Жыл бұрын
I dont see you create pivot table model, so i suppose that one is not necessary?
@codewithdary
@codewithdary Жыл бұрын
I've just rewatched the video because I thought I was crazy. Look again :)
@auroraapps1853
@auroraapps1853 2 жыл бұрын
Good work but : I was watching your course, but left because all videos are linked to previous one's please design in such a way that a novice viewer can easily grasp the concepts. I was watching API development playlist but you didn't teach how to configure msqli to commandline and I was wondering how to do so you was typing commands and fetching data :(
@codewithdary
@codewithdary 2 жыл бұрын
Sorry for that bud. I changed it up for my new tutorials :)
@auroraapps1853
@auroraapps1853 2 жыл бұрын
By the way your way of teaching is nice i like it. 👍
@AnkitPatel-pk1ts
@AnkitPatel-pk1ts 2 жыл бұрын
in hasonethrough Date was wrong...
@sulaimanmisri9570
@sulaimanmisri9570 3 жыл бұрын
I found this tutorial is more hard to understand compare to other tutorial :(
@codewithdary
@codewithdary 3 жыл бұрын
Completely understand you. But that’s because relationships are difficult in Laravel, watch it a couple times and you’ll get used to it.
@codewithdary
@codewithdary 3 жыл бұрын
@@carlmenger4964 interesting
@marcelrozendaal776
@marcelrozendaal776 3 жыл бұрын
@@carlmenger4964 I don't understand you're reaction??
@rajabhishek2936
@rajabhishek2936 3 жыл бұрын
Awosem
Challenge matching picture with Alfredo Larin family! 😁
00:21
BigSchool
Рет қаралды 40 МЛН
Советы на всё лето 4 @postworkllc
00:23
История одного вокалиста
Рет қаралды 5 МЛН
Joker can't swim!#joker #shorts
00:46
Untitled Joker
Рет қаралды 39 МЛН
🩷🩵VS👿
00:38
ISSEI / いっせい
Рет қаралды 18 МЛН
Introduction To Eloquent | Laravel For Beginners | Learn Laravel
45:20
Laravel Eloquent | Many to many relationship from zero to hero .
14:04
Laravel Eloquent: Deeper Relationships with One Query
10:37
Laravel Daily
Рет қаралды 139 М.
Challenge matching picture with Alfredo Larin family! 😁
00:21
BigSchool
Рет қаралды 40 МЛН