Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[11.x] add nullOnUpdate() method to ForeignKeyDefinition #52798

Merged
merged 2 commits into from
Sep 16, 2024

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
18 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants