Рет қаралды 49,606
In the one-to-many relationship, a single model owns a collection of models. For example, a user may have multiple posts. In this lesson, we will learn:
✔ hasMany()
✔ optional() helper function
✔ Default Models in belongsTo() relation: withDefault();
✔ Querying Relationship Existence: has(), whereHas()
✔ Querying Relationship Absence: doesntHave(), whereDoesntHave()
#Laravel #Eloquent
𝐋𝐚𝐫𝐚𝐯𝐞𝐥 𝐄𝐥𝐨𝐪𝐮𝐞𝐧𝐭 𝐑𝐞𝐥𝐚𝐭𝐢𝐨𝐧𝐬𝐡𝐢𝐩𝐬 𝐏𝐥𝐚𝐲𝐥𝐢𝐬𝐭
• Laravel Eloquent Relat...
𝐃𝐢𝐠𝐢𝐭𝐚𝐥𝐎𝐜𝐞𝐚𝐧 𝐑𝐞𝐟𝐞𝐫𝐫𝐚𝐥
m.do.co/c/e740...
Support my work:
1. On BuyMeACoffee: www.buymeacoff...
2. On Patreon: / qirolab
Also, follow us on:
𝐅𝐚𝐜𝐞𝐛𝐨𝐨𝐤: qirolab
𝐓𝐰𝐢𝐭𝐭𝐞𝐫: / qirolab