Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d9274f7

Browse files
committed
Protect developers from using forceDelete when not using trait.
1 parent 3fe430a commit d9274f7

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/Illuminate/Database/Eloquent/Model.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,6 +1112,18 @@ public function delete()
11121112
}
11131113
}
11141114

1115+
/**
1116+
* Force a hard delete on a soft deleted model.
1117+
*
1118+
* This method protects developers from running forceDelete when trait is missing.
1119+
*
1120+
* @return void
1121+
*/
1122+
public function forceDelete()
1123+
{
1124+
return $this->delete();
1125+
}
1126+
11151127
/**
11161128
* Perform the actual delete query on this model instance.
11171129
*

0 commit comments

Comments
 (0)