Vinelab / NeoEloquent

The Neo4j OGM for Laravel
MIT License
633 stars 197 forks source link

Laravel 6.0 Support #335

Closed oliverwhite19 closed 3 years ago

oliverwhite19 commented 4 years ago

Is there a plan to add support for the newest version of Laravel? The currently supported versions are getting to the end of their support period, so having the option to upgrade while using NeoEloquent would be great.

andy-uriarte commented 4 years ago

Seconding this. Does the latest version work with 6 without issue?

chrispage1 commented 4 years ago

@andy-uriarte I tried porting this and there's quite a bit now that needs updating to be compatible, not just a version bump. I'd say this project is abandoned, real shame with open-source ๐Ÿ‘Ž

YokiToki commented 4 years ago

@chrispage1 maybe you share your port. I donโ€™t think the backward compatibility is so broken between 5.6 and 6, we can made this working with 6.*. I really need some library for easy working with laravel and neo4j.

dmp593 commented 4 years ago

I would like to have support for laravel 6 too. Is there some news about this topic?

chrispage1 commented 4 years ago

@YokiToki - unfortunately I didn't get that far with it. I just had the files locally on my machine and gave up pretty early on. From memory there were a lot of methods requiring extra properties etc. I'd definitely like to see a port but haven't got the time or the in-depth Eloquent knowledge to commit to one.

berteltorp commented 4 years ago

At Ulobby we maintain a fork ulobby/neoeloquent, that has just been updated to work with 5.8 and we expect to support 6, well before 5.8 is EOL (February 26th, 2020).

We're also working on branch where we replace the underlying neo4j client with the official Neo4j node driver using a Rialto bridge.

We are committed to maintaining our fork, as we use it production ๐Ÿ˜…

YokiToki commented 4 years ago

@berteltorp, great news, I hope I will have free time to try to somehow help with it. Thanks.

chrispage1 commented 4 years ago

@berteltorp - great news indeed! Is it easy to get distant relationships, for example, if I have a user that has access to a file, and a file can have an infinite depth of subsequent files (like a directory structure), could I retrieve the furthest file in the chain?

berteltorp commented 4 years ago

@chrispage1

What you want to do is lookup based on a "variable length relationship" - and neo4j is perfect for that but it's not currently supported by neoeloquent.

One solution would be to use something like https://github.com/graphaware/neo4j-php-client to run a cypher query, and then get the id's of the files. And then run a subsequent query with neoeloquent to fetch those files and return a collection of Laravel models.

The cypher query could look something like this:

MATCH (user:User)-[:OWNS*..5]->(file:File)
WHERE id(user) = {$user_id}
RETURN id(file) as id

The *..5 signifies the depth you want the query to look. Depth can be omitted, by removing the ...5 but it is recommended to keep it.

The subsequent neoeleoquent query would then be: $files = File::whereIn('id',$ids_from_first_query')->get();

More info on variable length queries here: https://graphaware.com/graphaware/2015/05/19/neo4j-cypher-variable-length-relationships-by-example.html

berteltorp commented 4 years ago

We have released a version that works with Laravel 6.0: https://github.com/ulobby/NeoEloquent/releases

chrispage1 commented 4 years ago

@berteltorp - nice to see that someone is still pushing this! Thank you.

Mulkave commented 3 years ago

@berteltorp as far as i could see from your and @SimonThordal 's commits https://github.com/ulobby/NeoEloquent/compare/v6.0...6.0 these were the commits to have it compatible? or there is something else that's needed as well?

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.