klaussilveira/neo4j-ogm-bundle
Symfony bundle integrating the Neo4j PHP OGM, letting you map PHP entities to graph nodes, use repositories, and wire entity managers through Symfony's DI container. Includes annotation/attribute mapping and configuration for Neo4j connections.
composer require klaussilveira/neo4j-ogm-bundle – note this is a Symfony2 bundle, so you’ll need a Symfony2 project (or adapt the service definitions manually for Laravel).AppKernel.php: new Klaussilveira\Neo4jOgmBundle\Neo4jOgmBundle().config.yml under neo4j_ogm – typically host, port, username, password.@Node, @Property, @Relationship). The bundle wires an EntityManager service you can inject.README.md and the Resources/config/services.xml to see the service IDs and expected configuration keys. The underlying library is hirevoice/neo4jphp-ogm – its documentation is your primary reference for mapping and query methods.neo4j_ogm.entity_manager service into your services or controllers. This mirrors Laravel’s Eloquent facade but requires explicit injection.@Repository. Use it for complex Cypher queries while keeping entities clean.@Property, relationships via @Relationship, and nodes via @Node. This is similar to Doctrine ORM but for graph structures.$em->persist($entity), $em->flush(), $em->find('EntityClass', $id), $em->remove($entity).Client service for raw Cypher queries when the OGM’s abstraction is too limiting. The bundle may expose a neo4j_ogm.client service.Command/ directory. Run php app/console list to see available neo4j commands.transport, host, port). Double-check the bundle’s DependencyInjection/Configuration.php for exact schema.Client’s debug mode if available.flush() sparingly.services.yml to customise the entity manager or client. You can also create a compiler pass to register repositories.hirevoice/neo4jphp-ogm library directly. Create a service provider that binds an EntityManager singleton, and replicate the bundle’s configuration manually. The bundle itself is not needed.How can I help you explore Laravel packages today?