Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

set null on foreign key deletion in laravel

$table->foreignId('forign_id')->nullable()->constrained("table_name")->cascadeOnUpdate()->nullOnDelete();
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #set #null #foreign #key #deletion #laravel
ADD COMMENT
Topic
Name
4+3 =