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

Neo4J Laravel Eloquent Laravel Package

global-innovation/neo4j-laravel-eloquent

Brings native Neo4j graph database support to Laravel's Eloquent ORM. Define nodes and relationships as Eloquent models, run Cypher queries through a fluent query builder, traverse graphs via relationships, and manage schemas with Laravel-native syntax, migrations, and conventions.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. This package implements an Eloquent-style model layer over Neo4j, letting Laravel developers define graph nodes/relationships as classes with familiar idioms (attributes, relationship methods, query chaining) instead of hand-writing Cypher. The fit is strong only in one specific architecture: a relational system of record (MySQL/Postgres) that owns users, billing, and transactional data, with Neo4j added as a secondary graph store for traversal-heavy domains — social graphs, recommendations, fraud rings, RBAC/permission hierarchies, knowledge graphs, lineage. It is a poor fit as a wholesale Eloquent replacement: Neo4j has no schema migrations, no joins, and different transactional and indexing semantics, so the abstraction will leak whenever a query is more than a shallow traversal.

Integration feasibility. Mechanically low-friction: Composer install, a neo4j connection block in config/database.php, and model classes extending the package base. The real cost is not installation but the impedance mismatch — developers will discover mid-sprint that eager loading, whereHas, chunking, aggregates, and pagination behave differently or are unimplemented. Budget a spike to enumerate which Eloquent features actually work before committing to a design that assumes parity.

Technical risk.

  • Adoption/bus-factor risk (high). 10 stars implies effectively a single maintainer, minimal community validation, and few production war stories. MIT licensing removes legal friction but not the risk that a critical bug is fixed only by your own fork.
  • Semantic gap risk (high). Eloquent's contract is SQL-shaped. Anything the package doesn't support becomes raw Cypher escaped into your model layer, defeating the abstraction while still carrying its dependency.
  • Schema/migration risk (medium). Expect to manage constraints and indexes out-of-band (Cypher scripts or Neo4j migrations tooling), separate from Laravel's migration flow — a governance gap for environments and CI.
  • Dual-store consistency risk (high). Any graph projection from SQL requires an outbox/event pipeline; there are no distributed transactions between Bolt and SQL.
  • Abstraction-debugging risk (medium). Failures surface as Eloquent-shaped exceptions over Cypher; without Cypher literacy the team cannot read a query plan or diagnose a slow traversal.

Key questions.

  1. Which underlying PHP driver does it wrap (Laudis/official Bolt driver), and what Neo4j server versions are tested — 4.4, 5.x, Aura, cluster?
  2. Does it use Neo4j 5 elementId or the deprecated integer id? This determines forward compatibility.
  3. Which Eloquent features are actually implemented: relationships/eager loading, whereHas, pagination, chunking, aggregates, transactions, soft deletes?
  4. Are queries parameterized, or is Cypher assembled by string concatenation (injection and plan-cache implications)?
  5. Is there a schema/constraint management story, or is it fully manual?
  6. What is the testing story — can we run it against a disposable Neo4j container in CI?
  7. Is the maintainer responsive, and is there a released changelog/support policy beyond the Sept 2024 release?
  8. Does it support multiple connections and read/write routing for clustered deployments?

Integration Approach

Stack fit. Targets a modern Laravel (9–11) / PHP 8.1+ codebase with Bolt connectivity. It composes cleanly with Laravel's service container, config, and queue system; the graph connection can sit alongside existing SQL connections without disturbing them. Prerequisite: a provisioned Neo4j instance (self-hosted or Aura) and network egress over Bolt (7687), which is often the first surprise in locked-down VPCs.

Migration path. Do not migrate. Use a strangler-style addition: keep SQL as the system of record, introduce Neo4j for one bounded, traversal-shaped capability, and project only the subgraph that capability needs. Sync via domain events → queue → idempotent upserts (outbox pattern with a checkpoint), never synchronous dual-writes from the request path.

Compatibility. Verify elementId support, authentication mode (basic vs bearer/Aura), TLS settings, and timezone/type mapping (Neo4j temporal and spatial types vs PHP). Pin both the package and the Neo4j server minor version; treat driver upgrades as deliberate, tested events.

Sequencing.

  1. Spike (1–2 weeks): throwaway branch proving connection, model definition, one nontrivial traversal, and CI against a containerized Neo4j. Exit criteria: a documented list of supported vs unsupported Eloquent semantics.
  2. Read path first: build the graph projection from a backfill + event stream, expose read-only endpoints behind a feature flag. No writes to the graph from user traffic.
  3. Write path (if required): add graph mutations, wrapped in an internal repository/adapter so the package is swappable for raw Cypher or a different client.
  4. Harden: constraints/indexes as code, observability on query latency and traversal depth, then expand to a second use case only after the first is stable in production.

Operational Impact

Maintenance. Treat the package as a thin, replaceable adapter, not a foundational dependency: wrap it behind your own interfaces, pin versions, and be prepared to vendor/fork. Low release cadence means security and compatibility fixes may be your responsibility. Ongoing cost is modest for one bounded use case, but rises with every Eloquent feature you need and don't get.

Support. MIT, community-only, no vendor SLA. Internal ownership must be explicit — one or two engineers who can read Cypher and EXPLAIN/PROFILE a plan. Escalation path is upstream issues plus your own fork; plan accordingly for a Tier-1 feature.

Scaling. Graph performance is a function of traversal depth and fan-out, not row count — the opposite of the SQL intuition your team has. Enforce maximum traversal depth, LIMIT on every variable-length path, and pagination at the API boundary. Watch connection-pool sizing against Neo4j's per-database limits, and note that clustered/Aura deployments require routing-aware drivers. The projection pipeline (queue workers) becomes a scaling surface of its own under backfill or replay.

Failure modes.

  • Projection drift: graph silently diverges from SQL after a missed event or failed job — needs reconciliation jobs and drift metrics, not just retries.
  • Runaway traversal: an unbounded * path on a dense node exhausts heap and stalls the instance; guard at the query layer.
  • Cypher injection / plan-cache churn if query building is string-based.
  • Timeouts cascading into request latency when graph calls sit synchronously in a user request — degrade gracefully with a cached fallback.
  • Driver/server version skew after an unplanned Neo4j upgrade.
  • CI fragility if test environments lack a real Neo4j instance.

Ramp-up. A mid-level Laravel developer should be productive with the model layer in days, but productive with the graph in roughly one to two sprints — the gap is Cypher, data modeling (nodes vs properties vs relationships), and query-plan reading. Because the abstraction hides Cypher, that training is non-optional: without it the team cannot debug what the ORM generates. Net assessment: a reasonable, low-cost bet for a single graph-shaped feature in an existing Laravel app, contingent on the spike confirming feature coverage and on accepting single-maintainer risk; not a candidate for core-domain persistence.

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.
mehedimi/laravel-amp-mail
happones/laravel-vue-i18n-generator
jwerd/inertia-table
siberfx/flysystem-wasabi
hollyit/token-replace
ippanelcom/laravel-sdk
adachsoft/changelog-linter
adachsoft/collection
payerurl/telegrambot-crypto-payment-instant-payout
dskripchenko/laravel-hybrid-search
riorizkyrainey/lara-ced
mehedimi/static-vel
zharp/zharp
nonsapiens/bigquery-model-sync
lgu-bayambang-ict-office/lgu-laravel-development-standards
andydefer/laravel-support
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel