Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

add foreign key in laravel migration

$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #add #foreign #key #laravel #migration
ADD COMMENT
Topic
Name
5+3 =