{"action":"opened","issue":{"url":"https://api.github.com/repos/Vinelab/NeoEloquent/issues/138","labels_url":"https://api.github.com/repos/Vinelab/NeoEloquent/issues/138/labels{/name}","comments_url":"https://api.github.com/repos/Vinelab/NeoEloquent/issues/138/comments","events_url":"https://api.github.com/repos/Vinelab/NeoEloquent/issues/138/events","html_url":"https://github.com/Vinelab/NeoEloquent/issues/138","id":122313709,"number":138,"title":"`create` not included in transactions","user":{"login":"bramdevries","id":1002245,"avatar_url":"https://avatars.githubusercontent.com/u/1002245?v=3","gravatar_id":"","url":"https://api.github.com/users/bramdevries","html_url":"https://github.com/bramdevries","followers_url":"https://api.github.com/users/bramdevries/followers","following_url":"https://api.github.com/users/bramdevries/following{/other_user}","gists_url":"https://api.github.com/users/bramdevries/gists{/gist_id}","starred_url":"https://api.github.com/users/bramdevries/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bramdevries/subscriptions","organizations_url":"https://api.github.com/users/bramdevries/orgs","repos_url":"https://api.github.com/users/bramdevries/repos","events_url":"https://api.github.com/users/bramdevries/events{/privacy}","received_events_url":"https://api.github.com/users/bramdevries/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-15T16:40:01Z","updated_at":"2015-12-15T16:40:01Z","closed_at":null,"body":"I'm using Laravel 5.1 and in our tests we make use of database transactions to make sure all tests start with a clean slate.\r\n\r\nThe application has 2 databases: Mysql and neo4j. In one of our tests I'm using `Label::create()` to create a node.\r\n\r\nWe've setup our `setUp()` like this:\r\n\r\n```\r\n$db = $this->app->make('db');\r\n$db->beginTransaction();\r\n$db->connection('neo4j')->beginTransaction();\r\n\r\n$this->beforeApplicationDestroyed(function () use ($db) {\r\n     $db->connection('neo4j')->beginTransaction();\r\n     $db->rollback();\r\n});\r\n```\r\n\r\nHowever, after the tests are finished the nodes still exist in the database. \r\n\r\nI think the reason for this is that the `create` call doesn't use the transaction when the model uses incrementing ids. In that case it simply does a `node->save()` instead of passing through the `connection`:\r\n\r\n[`insertGetId`](https://github.com/Vinelab/NeoEloquent/blob/1.2.11/src/Vinelab/NeoEloquent/Query/Builder.php#L124) vs [`insert`](https://github.com/Vinelab/NeoEloquent/blob/1.2.11/src/Vinelab/NeoEloquent/Query/Builder.php#L532).\r\n\r\nIs there a specific reason the `insertGetId` does not use the connection instance? And if there isn't, is it possible to make use of it?\r\n\r\nI've also tried to \"cheat\" by using a `createWith()` instead, but then I suffer from another bug:\r\n\r\n```\r\nUnexpected end of input: expected whitespace or org$neo4j$cypher$internal$frontend$v2_3$parser$Clauses$$ReturnItem (line 1, column 169 (offset: 168))\r\n\"CREATE (project:`Project` { reference_id: 'acac5bd7-a6b7-43c7-b946-9ccb88c59232', updated_at: '2015-12-15 16:19:34', created_at: '2015-12-15 16:19:34'}) RETURN project,\"\r\n```\r\n\r\n(note the extra `,` at the end of the query, because I'm passing no relationships).\r\n\r\n\r\n"}}