Support the ongoing development of Laravel.io →
Database Eloquent
Last updated 2 years ago.
0
Solution

I found the error. These have to be added before the foreign key:

$table->integer('sender_id')->unsigned();
$table->integer('receiver_id')->unsigned();

Also, index is redundant, since Laravel adds it by default.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

gxgung gxgung Joined 9 Apr 2015

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.

© 2024 Laravel.io - All rights reserved.