DEV Community

loading...

eloquent relationships in 8 pics

Tefoh
・1 min read

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

Discussion (0)

Forem Open with the Forem app