📜  laravel 中可以为空的外键 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:53:44.355000             🧑  作者: Mango

代码示例1
$table
      ->foreignId('other_table_id')
      ->nullable() // here
      ->references('id')
      ->on('other_table');