php - Migration Table for Foreign Key Laravel 8

one text

Solution:

$table->unsignedBigInteger('id_rso');
$table->foreignId('id_rso')->constrained('rso');

Instead of this, just write:

$table->foreignId('id_rso')->constrained('rso');

Source