diff --git a/src/Illuminate/Database/Query/Builder.php b/src/Illuminate/Database/Query/Builder.php index 623ba961289c..bdd3a033c43b 100755 --- a/src/Illuminate/Database/Query/Builder.php +++ b/src/Illuminate/Database/Query/Builder.php @@ -1846,6 +1846,10 @@ public function update(array $values) */ public function increment($column, $amount = 1, array $extra = []) { + if (! is_numeric($amount)) { + throw new InvalidArgumentException("Non-numeric value passed to increment method."); + } + $wrapped = $this->grammar->wrap($column); $columns = array_merge([$column => $this->raw("$wrapped + $amount")], $extra); @@ -1863,6 +1867,10 @@ public function increment($column, $amount = 1, array $extra = []) */ public function decrement($column, $amount = 1, array $extra = []) { + if (! is_numeric($amount)) { + throw new InvalidArgumentException("Non-numeric value passed to decrement method."); + } + $wrapped = $this->grammar->wrap($column); $columns = array_merge([$column => $this->raw("$wrapped - $amount")], $extra);