// for laravel 7 or above. $table->foreignId('user_id')->constrained(); /*-----------OR---------------*/ $table->foreignId('user_id')->constrained('users');