O'Reilly logo

Learning Laravel's Eloquent by Francesco Malatesta

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4. Exploring the World of Relationships

United (and related) we stand, divided we fall.

In a real-world context, everything is connected; for example, a car has an owner, a book has an author (or maybe more than one), or an e-commerce order is related to one or more products that a customer (another relation!) has ordered.

Everything, actually, is related!

There are no differences in the application development world; usually, you create software to solve a real-world problem. The real world is made from related things, so you will probably have to define many relationships between your entities.

However, let's be clear: I am not saying anything new. Just go to Wikipedia and search for entity-relationship model.

Usually, in your school books, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required