LETS CONNECT THROUGH INSTAGRAM. www.Instagram.com/codewithdary
@shaquankelly66552 жыл бұрын
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!
@codewithdary2 жыл бұрын
Thanks for sharing bud!
@user-zm2dn8nn1u Жыл бұрын
Awesome sir u r live saver thanks from India
@dacpuspadewi3 жыл бұрын
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^^
@ramiavrahami87093 жыл бұрын
Dary, I think some additional part should be added which is talking about attach and sync functions. Great work !!
@codewithdary3 жыл бұрын
Thanks for the suggestion Rami!
@ttakaew1195 Жыл бұрын
thank you for making it easy for me, i really dumb
@codewithdary Жыл бұрын
No dumbs here, just a learning experience :)
@elkhanhamet25613 жыл бұрын
thank you Dary, appreciate your hard work for us man!!!👍👍👍👏👏👏👏.Stay safe!!!
@codewithdary3 жыл бұрын
Thank you, I will Elkhan, you too!
@codewithdary3 жыл бұрын
@@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...
@lauragriffiths33323 жыл бұрын
This has helped me loads, thank you
@codewithdary3 жыл бұрын
Glad it helped
@MaartenKnolle2 жыл бұрын
thank you very much. helped me a lot.
@codewithdary2 жыл бұрын
You're welcome!
@mr_presley2 жыл бұрын
This was a helpful video Thanks!
@codewithdary2 жыл бұрын
Glad it was helpful!
@odilurinkulov74893 жыл бұрын
Thank you!!!
@codewithdary3 жыл бұрын
You are Welcome Odil!
@shafiu2833 жыл бұрын
Great work!!!
@codewithdary3 жыл бұрын
Thank you so much 😀
@linglingzhang85832 жыл бұрын
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 Жыл бұрын
While making the function in Model, What is the rule for BelongsTo function e.g. will Changing product to product1 works?
@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 Жыл бұрын
I dont see you create pivot table model, so i suppose that one is not necessary?
@codewithdary Жыл бұрын
I've just rewatched the video because I thought I was crazy. Look again :)
@auroraapps18532 жыл бұрын
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 :(
@codewithdary2 жыл бұрын
Sorry for that bud. I changed it up for my new tutorials :)
@auroraapps18532 жыл бұрын
By the way your way of teaching is nice i like it. 👍
@AnkitPatel-pk1ts2 жыл бұрын
in hasonethrough Date was wrong...
@sulaimanmisri95703 жыл бұрын
I found this tutorial is more hard to understand compare to other tutorial :(
@codewithdary3 жыл бұрын
Completely understand you. But that’s because relationships are difficult in Laravel, watch it a couple times and you’ll get used to it.
@codewithdary3 жыл бұрын
@@carlmenger4964 interesting
@marcelrozendaal7763 жыл бұрын
@@carlmenger4964 I don't understand you're reaction??