- Does neo4j/neo4j-bundle work with Laravel?
- No. This is a Symfony bundle, and most of its value is Symfony-specific: the DI extension, auto-configured ClientInterface and Driver services, the semantic configuration tree, and the web profiler data collector for Cypher queries. On a Laravel codebase none of that applies, so you would use the underlying laudis/neo4j-php-client directly behind a custom service provider. Only adopt the bundle if a Symfony application is genuinely part of your stack.
- How do I install and configure neo4j/neo4j-bundle in Symfony?
- Install it with Composer, enable the bundle in your kernel or bundles.php, then configure your connections and driver settings under the bundle's neo4j configuration key. The bundle registers ClientInterface and driver services automatically so you can inject them into your services. Choose between the Bolt and HTTP transports based on your server setup and latency requirements.
- Which PHP, Symfony, and Neo4j versions does neo4j-bundle support?
- The bundle targets Symfony 6.4 and 7 with PHP 8.1 or newer. Neo4j server compatibility must be pinned explicitly because the Bolt protocol and Cypher dialect differ between Neo4j 4.4 and 5.x. Lock the underlying client to an exact minor version, since it does not follow Symfony or Laravel release cadences.
- How do I run a Cypher query from a Symfony service?
- Inject ClientInterface, which the bundle auto-configures, then call run() with your Cypher statement and a parameter array. Use explicit sessions and transactions for multi-statement or write workloads, and remember results are lazily consumed and formatted by the client. Keep client usage confined to repository or infrastructure classes rather than controllers and commands.
- What is the difference between neo4j/neo4j-bundle and laudis/neo4j-php-client?
- The bundle is Symfony glue: a DI extension, a configuration tree, and a profiler data collector. The laudis/neo4j-php-client package does the real work: Bolt and HTTP transports, session and transaction handling, lazy connections, result formatting, and typed exceptions. The bundle adds no capability you could not replicate in roughly 100 lines of framework-specific wiring.
- How do I integrate Neo4j into a Laravel app without this bundle?
- Require laudis/neo4j-php-client, add a config/neo4j.php file, and register a singleton Client instance in a service provider, optionally exposing a facade for ergonomics. Define repository interfaces in your domain layer and keep the client strictly inside infrastructure implementations. This is roughly a one-day task and gives you full control over configuration and observability.
- Is there built-in testing support for Neo4j queries?
- No, the bundle ships no framework-level test utilities, so you own the harness. Run integration tests against a real Neo4j instance using Testcontainers or a shared Aura or CI-hosted database, because Cypher behavior cannot be faked reliably with mocks. Keep a small read-only smoke test in CI to catch Bolt version drift early.
- Is neo4j/neo4j-bundle production ready and well maintained?
- The underlying laudis client is mature enough for production, with solid transport, session, and exception handling. Both the client and the bundle are effectively single-maintainer projects with community-only support and no vendor SLA, so budget a fork-or-patch contingency. A release in early 2025 is a positive signal, but keep your integration surface small enough that forking stays survivable.
- How do I debug or profile Cypher queries with this package?
- The bundle includes a Symfony web profiler data collector that shows the Cypher statements executed during a request, which is genuinely useful during development. That surface is Symfony-only, so in a Laravel app you lose it entirely and must add your own logging and timing around the client. Plan that observability work explicitly rather than assuming it comes free.
- What are the alternatives to neo4j/neo4j-bundle?
- For Laravel, use laudis/neo4j-php-client directly, since it is the actual dependency doing the work and the bundle adds nothing you can use. For Symfony applications the bundle remains the official option and simplifies configuration and injection. Before adopting either, confirm a graph database is justified rather than a relational schema or JSON column wearing a graph costume.