diff --git a/src/Illuminate/Database/Query/Builder.php b/src/Illuminate/Database/Query/Builder.php index 3ec55a5ff3fa..a28d1f8bb470 100755 --- a/src/Illuminate/Database/Query/Builder.php +++ b/src/Illuminate/Database/Query/Builder.php @@ -1415,7 +1415,7 @@ public function whereRowValues($columns, $operator, $values, $boolean = 'and') $this->wheres[] = compact('type', 'columns', 'operator', 'values', 'boolean'); - $this->addBinding($values); + $this->addBinding($this->cleanBindings($values)); return $this; } diff --git a/tests/Database/DatabaseQueryBuilderTest.php b/tests/Database/DatabaseQueryBuilderTest.php index 3b74507ad8a8..f150cec20184 100755 --- a/tests/Database/DatabaseQueryBuilderTest.php +++ b/tests/Database/DatabaseQueryBuilderTest.php @@ -2636,6 +2636,11 @@ public function testWhereRowValues() $builder = $this->getBuilder(); $builder->select('*')->from('orders')->where('company_id', 1)->orWhereRowValues(['last_update', 'order_number'], '<', [1, 2]); $this->assertEquals('select * from "orders" where "company_id" = ? or (last_update, order_number) < (?, ?)', $builder->toSql()); + + $builder = $this->getBuilder(); + $builder->select('*')->from('orders')->whereRowValues(['last_update', 'order_number'], '<', [1, new Raw('2')]); + $this->assertEquals('select * from "orders" where (last_update, order_number) < (?, 2)', $builder->toSql()); + $this->assertEquals([1], $builder->getBindings()); } public function testWhereRowValuesArityMismatch()