As I mentioned earlier, we will start from the basics. So, the first thing we will see is how you can define relationships between entities in Eloquent. This is really simple, and usually you will just have to add a single line of code for every relationship.
Our library is very concerned about tracking people who borrow books. For this reason, every new user has to give to the library some identity document data.
Now, every user has a single identity document, and every document is absolutely unique. If you think about it, this is a perfect one-to-one relationship. When you build your database, the most followed rule tells you that you have to add the necessary columns in the first table. In this specific example, we would add columns to the user table.
However, someone could say "yes, but this is a completely different entity!"
Also, we could have to store many details about the identity document of every user: number, type, due...