stefanak-michal/bolt
Low-level PHP library for communicating with graph databases over TCP using the Bolt protocol. Works with Neo4j, Memgraph, Amazon Neptune and others, supports Bolt up to version 6, requires PHP 8.1+ with mbstring, and needs sockets or openssl only for certain connection classes.
Adopt if:
Look elsewhere if:
Upgrade watch-outs for v7.5.0:
AProtocol constructor signature changed — safe if you obtain the protocol via Bolt::build() (recommended path); direct instantiation will break.autoload.php removed — confirm you’re relying on Composer autoload (standard for Laravel).For Executives: "This package lets us leverage graph databases (like Neo4j, Memgraph, or ArcadeDB) directly from PHP/Laravel, unlocking real-time, high-performance queries for use cases like fraud detection or recommendation engines. It’s a drop-in Bolt driver—no REST overhead, no vendor lock-in—while keeping our stack PHP-native. The latest release (v7.5.0) adds cluster-aware bookmarks and standard PSR-3 logging, which means we can run it in production multi-node deployments and feed logs into our existing observability stack instead of building that ourselves. It also expands tested compatibility to ArcadeDB, TuGraph, and Grafeo, giving us negotiating leverage and exit options across vendors. For example, we could replace slow SQL joins with millisecond graph traversals, cutting latency dramatically in scenarios like supply chain optimization. The MIT license and active maintenance (last release: 2026-03) make it a low-risk choice."
For Engineering: *"This is a low-level Bolt client for PHP 8.1+, now supporting Bolt 6.1. Key benefits:
UnsupportedType structure for gracefully handling unknown protocol types.mbstring/sockets (optional OpenSSL).
Migration notes for v7.5.0: The AProtocol constructor signature changed (non-breaking if you use Bolt::build()), the ability to manually set the PackStream version is deprecated (it’s now tied to Bolt version), and the internal autoload.php was removed (Composer handles it). Use case: If we’re building a Laravel service for graph analytics, this avoids REST latency, lets us issue Cypher queries natively, and now supports cluster-consistent reads. Tradeoff: More control but less abstraction than Neo4j’s official driver. Pair with a helper layer (e.g., Laravel service) to hide Bolt complexity."*For Developers: *"Need to query Neo4j/Memgraph/ArcadeDB from PHP without REST? This package gives you raw Bolt 6.1 protocol access with:
run(), pull(), begin()) matching Bolt specs, plus a new query method for convenience.Log) and Bolt traffic/debug events flow into your normal log pipeline.UnsupportedType wrapper so unknown wire types don’t blow up.
Example: Replace DB::select() with $bolt->run('MATCH (n) RETURN n')->pull() for graph data. Upgrade checklist: stay on Bolt::build() (don’t touch AProtocol constructor directly), remove any setPackStreamVersion() calls, and delete any references to the old internal autoload.php. Docs link to Neo4j’s Bolt specs for version-specific details. Start with the Client helper class to simplify boilerplate."*How can I help you explore Laravel packages today?