📜  laravel 更改外键名称 - PHP 代码示例

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

代码示例4
$table->foreignId('user_id')
      ->constrained("users") <- // You don't need to specify table if it matched laravel naming conventions.
      ->onUpdate('cascade')
      ->onDelete('cascade');