Skip to content

Conversation

@gisuNasr
Copy link
Contributor

Summary:

This PR introduces the nullOnUpdate() method to the ForeignKeyDefinition class. This method allows for setting the foreign key value to null when the referenced record is updated.

Usage:

$table->foreign('user_id') ->references('id') ->on('users') ->nullOnUpdate();
@taylorotwell taylorotwell merged commit 0890706 into laravel:11.x Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants