Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

Laravel create foreign key column in migration

$table->foreignId('post_id')
                ->constrained()
                ->onUpdate('cascade')
                ->onDelete('cascade');
Source by devsenv.com #
 
PREVIOUS NEXT
Tagged: #Laravel #create #foreign #key #column #migration
ADD COMMENT
Topic
Name
4+5 =