Support the ongoing development of Laravel.io →
Artisan Laravel

Salut je me suis lancé dans laravel ya quelques semaines. je m'exerce sur un projet test j'ai crée des migrations de chaque model de ma BD et lorsque je lance la commande php artisan migrate la migration commence et se bloque juste au niveau des tables d'associations.

voici l'erreur que j'ai : " SQLSTATE[42000]: Syntax error or access violation: 1072 Key column 'id' doesn't exist in table (Connection: mysql, SQL: alter table enseignant_matiere add constraint enseignant_matiere_id_foreign foreign key (id) references enseignants (id))" .

0
moderator

Hello @marnelle-dev

I'm sorry but this forum is English, can you translate your question? Else we need to remove this thread.

0

Sign in to participate in this thread!

PHPverse

Your banner here too?

Moderators

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

Your logo here?

Laravel.io

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

© 2025 Laravel.io - All rights reserved.