diff --git a/src/Vinelab/NeoEloquent/Query/Grammars/Grammar.php b/src/Vinelab/NeoEloquent/Query/Grammars/Grammar.php index 6f877001..9a5925aa 100644 --- a/src/Vinelab/NeoEloquent/Query/Grammars/Grammar.php +++ b/src/Vinelab/NeoEloquent/Query/Grammars/Grammar.php @@ -84,7 +84,7 @@ public function wrapLabel($label) */ public function prepareRelation($relation, $related) { - return "rel_". mb_strtolower($relation) .'_'. $related .":{$relation}"; + return "`rel_". mb_strtolower($relation) .'_'. $related ."`:`{$relation}`"; } /** diff --git a/tests/Vinelab/NeoEloquent/Query/GrammarTest.php b/tests/Vinelab/NeoEloquent/Query/GrammarTest.php index 9a977829..43776447 100644 --- a/tests/Vinelab/NeoEloquent/Query/GrammarTest.php +++ b/tests/Vinelab/NeoEloquent/Query/GrammarTest.php @@ -71,7 +71,7 @@ public function testPreparingLabel() public function testPreparingRelationName() { - $this->assertEquals('rel_posted_post:POSTED', $this->grammar->prepareRelation('POSTED', 'post')); + $this->assertEquals('`rel_posted_post`:`POSTED`', $this->grammar->prepareRelation('POSTED', 'post')); } public function testNormalizingLabels()