Support the ongoing development of →
Database Eloquent
Last updated 2 years ago.

The table you reference in the last foreign key statement is 'car' but the table is 'cars'.

Does this help?

Last updated 2 years ago.

This issue hasn't even been fixed in 5.1. What can we do to have Tyler fix this in the next release?


As I see, this is not a laravel issue, this is a MySQL issue.

IMHO, is not a bug, its a detail of implementation: you cannot reference a FK to a yet-not-created table and table PK.

The way around that is simple: order your migrations to guarantee that all FK declarations references pre-created tables.

Last updated 8 years ago.

Sign in to participate in this thread!


Your banner here too?

erneyja erneyja Joined 13 Feb 2014


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 - All rights reserved.