phpneo4jlaravel-5neoeloquent

Laravel NeoEloquent ignores "CONSTRAINT" on ::create command


So I just started to write my API, and came across this bug:

On creating user that has unique CONSTRAINT twice, There is exception returned, but the node is still being created!

The CONSTRAINT is on "User:access_token" property, and I'm using the following code:

try {
    $userAttributes = [
        "email" => $request->email,
        "access_token"  =>  'aaaa',
        "facebook_id"   =>  'bbbb'
    ];
    $user = new User($userAttributes);
    $user->save();
}catch (Exception $e){}

Any help please?


Solution

  • This issue is due to the underlying driver using the REST API instead of executing a Cypher query. As a workaround (at the time of this answer) there's a NeoEloquent branch 1.5-dev that uses a different driver and it will be used to run Cypher against the database. This branch is still under development but currently fully backward-compatible.

    To install it add the version dev-1.5-dev to your composer.json file and run composer update vinelab/neoeloquent.