diff --git a/src/Illuminate/Database/Query/Grammars/MySqlGrammar.php b/src/Illuminate/Database/Query/Grammars/MySqlGrammar.php index 8dff604ae6c3..8f4f81d0fcee 100755 --- a/src/Illuminate/Database/Query/Grammars/MySqlGrammar.php +++ b/src/Illuminate/Database/Query/Grammars/MySqlGrammar.php @@ -9,6 +9,13 @@ class MySqlGrammar extends Grammar { + /** + * The grammar specific operators. + * + * @var array + */ + protected $operators = ['sounds like']; + /** * The components that make up a select clause. * diff --git a/tests/Database/DatabaseQueryBuilderTest.php b/tests/Database/DatabaseQueryBuilderTest.php index ac5b228302e2..49d514b6bd67 100755 --- a/tests/Database/DatabaseQueryBuilderTest.php +++ b/tests/Database/DatabaseQueryBuilderTest.php @@ -1940,6 +1940,14 @@ public function testSqlServerLimitsAndOffsets() $this->assertEquals('select * from (select *, row_number() over (order by [email] desc) as row_num from [users]) as temp_table where row_num between 11 and 20', $builder->toSql()); } + public function testMySqlSoundsLikeOperator() + { + $builder = $this->getMySqlBuilder(); + $builder->select('*')->from('users')->where('name', 'sounds like', 'John Doe'); + $this->assertEquals('select * from `users` where `name` sounds like ?', $builder->toSql()); + $this->assertEquals(['John Doe'], $builder->getBindings()); + } + public function testMergeWheresCanMergeWheresAndBindings() { $builder = $this->getBuilder();