Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Neo4Jphp Ogm Laravel Package

hirevoice/neo4jphp-ogm

Neo4j PHP Object Graph Mapper: an object management layer built on neo4jphp that lets you persist and retrieve entities in Neo4j via REST. Doctrine-style annotations, entity manager, repositories, and automatic relationship handling.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit

  • The package is a Doctrine-style OGM for Neo4j built on everyman/neo4jphp and Doctrine Common. It fits a PHP domain model where graph traversal is central: social graphs, recommendations, dependency mapping, fraud/relationship analysis, or knowledge graphs.
  • It is not Laravel-native. Laravel’s default persistence stack is Eloquent/PDO; this package introduces a separate entity manager, annotation metadata, and graph transaction model. Treat it as a bounded-context adapter, not a replacement for Eloquent.
  • The OGM abstraction can reduce Cypher boilerplate for CRUD-like graph entities, but complex traversals will still require Cypher. Teams should not assume the OGM hides graph modeling complexity.
  • Strongest fit is an internal prototype or isolated graph feature where Doctrine-style entities and annotation mapping are acceptable.

Integration feasibility

  • Composer installation is feasible, but Laravel integration will likely require manual wiring: configuration, singleton binding for the OGM entity manager, repository/service abstractions, and lifecycle management.
  • The package is REST-connector based, not a modern Bolt driver. This is a major compatibility concern for current Neo4j versions and latency-sensitive workloads.
  • Dependency age is the primary feasibility risk. Doctrine Common, annotation parsing, PHP version constraints, and everyman/neo4jphp compatibility must be proven against the target Laravel and PHP versions before commitment.
  • Adoption evidence is thin: 157 stars, zero dependent packages, and README/docs-level maturity. This suggests limited production validation outside the originating project.

Technical risk

  • High maintenance risk: the library appears old, Travis-era, and not aligned with modern Neo4j drivers or Laravel releases.
  • High integration risk: REST-only access, possible lack of transaction parity, and unclear support for current Neo4j authentication, TLS, and cluster topologies.
  • Medium-high data-model risk: OGM annotations can encourage relational modeling in a graph store; relationship direction, cardinality, constraints, and index strategy still need explicit ownership.
  • Medium operational risk: lazy loading and relationship traversal can produce hidden HTTP calls and N+1-style graph access patterns.
  • Security/compliance risk: credentials, Cypher injection surfaces, and data residency must be reviewed before any production use.

Key questions

  • Which Neo4j version and deployment model must be supported: Community, Enterprise, Aura, clustered, or on-prem?
  • Is graph data a system of record or a derived read model? If derived, what is the rebuild source?
  • Which Laravel and PHP versions are mandatory, and does the dependency tree resolve without patching?
  • Are transaction boundaries acceptable over REST, and how are partial writes handled?
  • Who owns the package fork/vendor patch if upstream is inactive?
  • What is the exit strategy if the OGM cannot support Neo4j 5+ or current Laravel?

Integration Approach

Stack fit

  • Use the package behind a narrow graph-service interface, not directly in controllers or Eloquent models. Expose domain repositories and keep OGM annotations out of core business entities where possible.
  • Keep Laravel’s relational database as the primary transactional system unless the graph is explicitly the system of record. Use the graph for relationship-heavy read paths and derived projections.
  • Bind an EntityManager-like service in a Laravel service provider, with configuration for endpoint, credentials, timeout, and environment-specific settings.
  • Do not mix Eloquent database transactions with graph operations. Use domain events, queues, or an outbox pattern to synchronize relational and graph data.

Migration path

  • Phase 1: dependency and compatibility spike. Prove installability, authentication, CRUD, relationship mapping, and transaction behavior against the target Laravel/PHP/Neo4j versions.
  • Phase 2: build a throwaway vertical slice for one graph use case with explicit success metrics: latency, query count, consistency, and failure recovery.
  • Phase 3: if successful, isolate in a module with repository interfaces, integration tests, and a documented fallback to raw Cypher or a maintained Neo4j driver.
  • Phase 4: production hardening only after replacing or wrapping risky dependency points. Maintain a fork/patch policy and an exit plan.

Compatibility

  • Validate PHP version, Doctrine Common version, annotation support, and autoloading under the target Laravel release.
  • Confirm Neo4j HTTP API compatibility, auth mechanism, TLS, and response formats. Do not assume current Neo4j support from README examples.
  • Test against the exact Neo4j edition and version used in staging/production, including connection loss and timeout behavior.
  • Confirm whether relationship mapping, lazy loading, and identity mapping behave correctly with large result sets and cycles.

Sequencing

  1. Dependency audit and security review.
  2. Compatibility spike with a disposable Laravel app.
  3. Define bounded context and repository contracts.
  4. Implement schema constraints/indexes outside Laravel migrations.
  5. Build integration tests with real Neo4j.
  6. Add observability, timeouts, retries, and circuit breaking.
  7. Canary one use case; document rollback and replacement path.

Operational Impact

Maintenance

  • Expect low upstream velocity and limited issue response. Budget for fork ownership, dependency pinning, and periodic compatibility patches.
  • Annotation-based mapping increases upgrade friction because metadata parsing and Doctrine Common changes can break silently.
  • Maintenance ownership must sit with a named team; this should not be adopted as an unowned utility.

Support

  • Support is community-only. There is no commercial backing evident, and zero dependents reduce the likelihood of external production hardening.
  • Internal runbooks should cover Neo4j connectivity, OGM configuration, entity mapping errors, and fallback to direct Cypher.
  • Security support for old REST connectors and PHP annotations must be reviewed independently.

Scaling

  • REST access adds HTTP overhead per operation and may limit throughput versus Bolt. Hidden lazy loads can multiply calls.
  • Large graph traversals should be pushed to Cypher and paginated; the OGM should not be used as a generic graph query engine.
  • Monitor PHP memory, serialization cost, Neo4j query latency, and connection reuse. Horizontal PHP scaling may amplify REST connection pressure.
  • For high-volume or latency-sensitive features, a maintained Bolt-based client is likely required.

Failure modes

  • REST timeouts or Neo4j unavailability causing partial writes and inconsistent graph state.
  • Dual-write divergence between Laravel/MySQL and Neo4j.
  • Incompatibility after Neo4j or PHP upgrades.
  • Annotation/metadata parsing failures after Composer updates.
  • Unbounded relationship loading, cycles, and N+1 graph calls.
  • Credential leakage or overly broad database permissions.
  • Orphaned nodes/relationships when deletes are not modeled explicitly.

Ramp-up

  • Doctrine users will recognize the entity manager pattern, but graph modeling, Neo4j operations, and Cypher performance remain separate skills.
  • Plan training for relationship modeling, index/constraint design, traversal patterns, and graph backup/restore.
  • Start with one bounded use case and a small enablement cohort. Measure time-to-first-query, defect rate, and operational incidents before expanding.
  • TPM recommendation: leverage this package as a short-cycle evaluation accelerator or isolated prototype, not as a strategic production platform unless the compatibility spike and ownership model are explicitly funded.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core