Skip to content

Commit 40afd67

Browse files
[8.x] Add restrictOnUpdate() method to the schema builder (#39350)
* Add restrictOnUpdate() method to the schema builder Hi, Laravel has a `cascadeOnUpdate()` but does not have a `restrictOnUpdate()`. I know that i can use `onUpdate('restrict')` but since laravel already has a helper for the cascade and also has a restrict helper for the delete, it only makes sense to add helper for the restrict on update as well. * Update ForeignKeyDefinition.php Co-authored-by: Taylor Otwell <[email protected]>
1 parent 1fb0df4 commit 40afd67

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/Illuminate/Database/Schema/ForeignKeyDefinition.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,16 @@ public function cascadeOnUpdate()
2424
return $this->onUpdate('cascade');
2525
}
2626

27+
/**
28+
* Indicate that updates should be restricted.
29+
*
30+
* @return $this
31+
*/
32+
public function restrictOnUpdate()
33+
{
34+
return $this->onUpdate('restrict');
35+
}
36+
2737
/**
2838
* Indicate that deletes should cascade.
2939
*

0 commit comments

Comments
 (0)