#5.1 One to Many & One to One Polymorphic Relationships | Laravel Eloquent Relationships
HTML-код
- Опубликовано: 18 май 2020
- In the #Laravel Eloquent Relationships, we have seen standard one-to-one, one-to-many, many-to-many, and has-many-through relations. Next, in this video, we will see polymorphic relationships. It is not so common, but very powerful when it is needed.
In this video, you will learn,
✔ One To One (Polymorphic)
✔ One To Many (Polymorphic)
𝐋𝐚𝐫𝐚𝐯𝐞𝐥 𝐄𝐥𝐨𝐪𝐮𝐞𝐧𝐭 𝐑𝐞𝐥𝐚𝐭𝐢𝐨𝐧𝐬𝐡𝐢𝐩𝐬 𝐏𝐥𝐚𝐲𝐥𝐢𝐬𝐭
• Laravel Eloquent Relat...
Also, follow us on:
𝐅𝐚𝐜𝐞𝐛𝐨𝐨𝐤: qirolab
𝐓𝐰𝐢𝐭𝐭𝐞𝐫: / qirolab Наука
Great tutorial, thank you.
nice tutorial.........thanks
hey, do you have any idea how the reverse structure would work ?? for ex: we have the morphTo model record created first- let's say we have a case where we create App\User model which will have MorphOne relation to App\EmployeeDetail and App\FreelancerDetail so in this case we have our Users registering first and based on their profile is when we add data to the concerned tables of either EmployeeDetail or FreelancerDetail, or it can even be like Admin or User on the User Table.. hope you understood what am trying to convey.. have you ever come across a need for shaping such a structure ??? let me know.. thanks..!!
Thanks
fantastic video, thank you
Glad you liked it!
Excellent!
Thank you! Cheers!
thank you for your effort !
verry helpfull
Thank you! Cheers!
Great job
Glad you like it!
Cant we add a field in dbtable like "commentType" and save which type of comment inside it? Like for Videocomment - Video & for post - post? or we can set any numeric value as well like 1 for video and 2 for post???
whats your database manager app?!
thank
welcome
hi sir could you please make a tutorial on other concepts on relationship like (join, query on model,multiple eager loading model(and query on specific one))
noted. I will make videos on this as well. Thanks
how to make an update method using morph?
how to update?
sir which database u r using
MySql