Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel on delete set null

$table->...->onDelete('set null');

#First make sure you set the foreign key field as nullable:
$table->integer('foreign_id')->unsigned()->nullable();
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #laravel #delete #set #null
ADD COMMENT
Topic
Name
5+4 =