Eloquent relationships यह मॉडल करते हैं कि database tables कैसे संबंधित हैं, जो models पर methods के रूप में परिभाषित होते हैं। Laravel सभी सामान्य relationship types का समर्थन करता है — one-to-many, many-to-many, one-to-one, और अधिक — जो आपको संबंधित data तक elegant, object-oriented access देता है।
One-to-many (hasMany / belongsTo)
{
{
->(::);
}
}
{
{
->(::);
}
}
->posts;
->author;
->()->(, )->();
