Schema::table('posts', function (Blueprint $table) { $table->foreignId('user_id')->constrained(); });