Skip to content

Glossary: Laravel

Foreign key

Also written: foreignId, constrained(), cascadeOnDelete

A column that points at a row in another table, such as orders.user_id pointing at users. In a migration, foreignId()->constrained() creates one.

Where the book teaches it

Related terms

MigrationRelationship