Migración de Laravel en Eliminar el conjunto nulo
$table->...->onDelete('set null');
TheDutchScorpion
$table->...->onDelete('set null');
$table->...->onDelete('set null');
#First make sure you set the foreign key field as nullable:
$table->integer('foreign_id')->unsigned()->nullable();
$table->foreignId('user_id')
->constrained()
->onDelete('cascade');