Skip to content

Commit

Permalink
Add restrictOnUpdate() method to the schema builder
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
shadoWalker89 committed Oct 25, 2021
1 parent 1fb0df4 commit 0551858
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Illuminate/Database/Schema/ForeignKeyDefinition.php
Expand Up @@ -34,6 +34,16 @@ public function cascadeOnDelete()
return $this->onDelete('cascade');
}

/**
* Indicate that updates should be restricted.
*
* @return $this
*/
public function restrictOnUpdate()
{
return $this->onUpdate('restrict');
}

/**
* Indicate that deletes should be restricted.
*
Expand Down

0 comments on commit 0551858

Please sign in to comment.