Many to many relationships are a bit more confusing to understand. Let's break it down by reviewing the common "posts" and "tags" relationship. A one-to-one or one-to-many relationship isn't quite right here. A post will never own a tag. It can be associated with one, sure, but it doesn't own the tag. The same is true in reverse. When we encounter situations such as this, a "many-to-many" relationship is exactly what we need.
Published on Aug 27th, 2018.
Understand.io is used by hundreds of Laravel developers to find and fix errors.
Sign up for a free 14-day trial now.