Skip to content

Commit

Permalink
[11.x] add nullOnUpdate() method to ForeignKeyDefinition (#52798)
Browse files Browse the repository at this point in the history
* add nullOnUpdate() method to ForeignKeyDefinition

* Update ForeignKeyDefinition.php

---------

Co-authored-by: Taylor Otwell <[email protected]>
  • Loading branch information
gisuNasr and taylorotwell authored Sep 16, 2024
1 parent 6143186 commit 0890706
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Illuminate/Database/Schema/ForeignKeyDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ public function restrictOnUpdate()
return $this->onUpdate('restrict');
}

/**
* Indicate that updates should set the foreign key value to null.
*
* @return $this
*/
public function nullOnUpdate()
{
return $this->onUpdate('set null');
}

/**
* Indicate that updates should have "no action".
*
Expand Down

0 comments on commit 0890706

Please sign in to comment.