那就设置外键就行了
public function up()
{
Schema::create('question_topic', function (Blueprint $table) {
$table->increments('id');
$table->integer('question_id')->unsigned()->index();
$table->integer('topic_id')->unsigned()->index();
$table->foreign('question_id')->references('id')->on('questions')->onDelete('cascade');
$table->foreign('topic_id')->references('id')->on('topics')->onDelete('cascade');
$table->timestamps();
});
}