Romain
4 weeks ago

onDelete('cascade') means...

Posted 4 weeks ago by Romain

hey

very quick and easy one but I'm confused with the docs. When I write:

$table->foreignId('submitted_by')->references('id')->on('users')->onDelete('cascade');

I hope that means: When the user with that ID is deleted, then delete this record. Am I right or is it the other way around?

Please sign in or create an account to participate in this conversation.