Answers for "cannot add foreign key constraint laravel 8"

PHP
1

Laravel adding Foreign Key Constraints

$table->foreignId('user_id')
      ->constrained("users") <- // You don't need to specify table if it matched laravel naming conventions.
      ->onUpdate('cascade')
      ->onDelete('cascade');
Posted by: Guest on June-16-2021

Code answers related to "cannot add foreign key constraint laravel 8"

Browse Popular Code Answers by Language