Answer the question
In order to leave comments, you need to log in
How to remove ->onDelete('set null') in migration?
$table->foreignId('user_id')->nullable()->constrained('users')->onDelete('set null');
Answer the question
In order to leave comments, you need to log in
With softDelete, the record is not deleted, only the deleted_at field is filled.
Therefore, the onDelete('set null') trigger does not fire and the value is not set to zero.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question