Relationships

This is the official documentation of the forestadmin/laravel-forestadmin v2+ and forestadmin/symfony-forestadmin PHP agents.

A join is used to combine rows from two or more tables, based on a related column between them.

Declaration

In Forest Admin, relations are defined as fields and are traversable in only one direction.

Join Types

Four join types are available: ManyToOne, ManyToMany, OneToMany, and OneToOne.

TypeWhere are the common keys?

ManyToOne

origin[foreignKey] == foreign[foreignKeyTarget]

OneToMany

origin[originKeyTarget] == foreign[originKey]

ManyToMany

origin[originKeyTarget] == through[originKey] && though[foreignKey] == foreign[foreignKeyTarget]

OneToOne

origin[originKeyTarget] == foreign[originKey]

Last updated