everyman/neo4jphp
Neo4jPHP is a PHP wrapper for the Neo4j graph database REST API. Connect to a Neo4j server, inspect server info, and work with graph data and Cypher queries via a simple client. Installable via Composer.
.env configuration for credentials).graphaware/neo4j-php-client (Bolt protocol) or jenssegers/neo4j (REST + Bolt).(:User)-[:HAS]->(:Post))config/app.php), supports .env for Neo4j credentials, and integrates with Laravel’s logging (Monolog).GraphService::findUserConnections()) to decouple Laravel models from the graph.// Laravel Service
class GraphService {
protected $neo4j;
public function __construct(Everyman\Neo4j\Client $neo4j) {
$this->neo4j = $neo4j;
}
public function getUserFriends($userId) {
return $this->neo4j->cypher('MATCH (u:User)-[:FRIENDS_WITH]->(f) WHERE u.id = $id RETURN f')
->params(['id' => $userId])
->get();
}
}
.env:
NEO4J_HOST=localhost
NEO4J_PORT=7474
NEO4J_USER=neo4j
NEO4J_PASSWORD=password
$client = new Everyman\Neo4j\Client(
config('neo4j.host'),
config('neo4j.port'),
config('neo4j.user'),
config('neo4j.password')
);
dispatch(new GraphSyncJob($data))).neo4jNodeCreated) after graph operations.How can I help you explore Laravel packages today?