📅  最后修改于: 2022-03-11 14:53:41.695000             🧑  作者: Mango
// for laravel 7 or above.
$table->foreignId('user_id')->constrained();
/*-----------OR---------------*/
$table->foreignId('user_id')->constrained('users');