Laravel: Understanding Eloquent Relationships… with drawings!

Everything just becomes more easy when you put some pictures on it

Image for post
Image for post
Photo by Jakob Owens on Unsplash

One to One

Image for post
Image for post

One to Many

Image for post
Image for post

Many to Many

Image for post
Image for post

Has One Through

Image for post
Image for post
Image for post
Image for post

Has Many Through

Image for post
Image for post
Image for post
Image for post

One to One Polymorphic

Image for post
Image for post

One to Many Polymorphic

Image for post
Image for post

Many to Many Polymorphic

Image for post
Image for post

Graphic Designer graduate. Full Stack Web Developer. Retired Tech & Gaming Editor.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store