DEV Community

Tefoh
Tefoh

Posted on • Updated on

eloquent relationships in 8 pics

here's the laravel eloquent relationships in simple example(from docs).

1- one-to-one
one-to-one
2- one-to-many
one-to-many
3- many-to-many
many-to-many
4- has-one-through
has-one-through
5- has-many-through
has-many-through
6- one-to-one-polymorphic
one-to-one-polymorphic
7- one-to-many-polymorphic
one-to-many-polymorphic
8- Many-to-many-polymorphic
Many-to-many-polymorphic

edit

9- has-one-of-many
Alt Text

Top comments (0)