diff --git a/src/Illuminate/Database/Query/Builder.php b/src/Illuminate/Database/Query/Builder.php index ec80f4208d5e..ffbf88b1281b 100755 --- a/src/Illuminate/Database/Query/Builder.php +++ b/src/Illuminate/Database/Query/Builder.php @@ -579,7 +579,7 @@ public function orWhere($column, $operator = null, $value = null) */ protected function invalidOperatorAndValue($operator, $value) { - $isOperator = in_array($operator, $this->operators) && in_array($operator, $this->grammar->getOperators()); + $isOperator = in_array($operator, $this->operators); return $isOperator && $operator != '=' && is_null($value); } diff --git a/tests/Database/DatabaseEloquentBuilderTest.php b/tests/Database/DatabaseEloquentBuilderTest.php index 8c983aaa8aa4..41e0499f6760 100755 --- a/tests/Database/DatabaseEloquentBuilderTest.php +++ b/tests/Database/DatabaseEloquentBuilderTest.php @@ -438,6 +438,14 @@ public function testSimpleWhere() $this->assertEquals($result, $builder); } + public function testPostgresOperatorsWhere() + { + $builder = $this->getBuilder(); + $builder->getQuery()->shouldReceive('where')->once()->with('foo', '@>', 'bar'); + $result = $builder->where('foo', '@>', 'bar'); + $this->assertEquals($result, $builder); + } + public function testDeleteOverride() { $builder = $this->getBuilder();