Lesson 10 Laravel Relationships in depth

preview_player
Показать описание
In this lesson, we'll dive deep into Laravel relationships, exploring the three main types: one-to-one, one-to-many, and many-to-many. We'll start with the basics, looking at how to define relationships between models using foreign keys and Eloquent's convenient query methods. From there, we'll move on to more advanced topics, such as eager loading, lazy loading, and eager loading constraints. We'll also explore how to work with pivot tables to represent many-to-many relationships, including creating and updating pivot records. Along the way, we'll use a sample database schema to illustrate these concepts in practice, building out relationships between students, teachers, classes, and subjects. Whether you're new to Laravel or a seasoned pro, this lesson will help you gain a deeper understanding of how relationships work in this powerful PHP framework.

chapters:

0:00 Introduction
0:30 Diagram
01:40 Creating One-to-One Relationship
04:28 Creating One-to-Many Relationship
06:09 Creating Many-to-Many Relationship
09:17 Creating Classes Relationships
13:37 Selecting second Level Relationship
19:16 Selecting Specific Columns in Relationship
21:15 Where Conditions in Relationship
27:20 Aggregate Functions in Relationship
Комментарии
Автор

I am very clear after watching this video, thank you so much bro.

aungkyawmoe
Автор

Thanks for the tutorial. How did you install and configure jsoneditor?

fggwbdh
Автор

brother when do we need to add call back function in query .like you used function ($query) in 17:50 .... can you explain that please?

usamaramzan