PHPackages                             dwoodard/neo4j-eloquent - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. dwoodard/neo4j-eloquent

ActiveLibrary[Database &amp; ORM](/categories/database)

dwoodard/neo4j-eloquent
=======================

Eloquent-style API for Neo4j graph database interactions with schema-less, dynamic operations

v1.0.6(11mo ago)231MITPHPPHP ^8.2

Since Jul 13Pushed 11mo agoCompare

[ Source](https://github.com/dwoodard/neo4j-eloquent)[ Packagist](https://packagist.org/packages/dwoodard/neo4j-eloquent)[ Docs](https://github.com/dwoodard/neo4j-eloquent)[ RSS](/packages/dwoodard-neo4j-eloquent/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (4)Versions (8)Used By (0)

Neo4j Eloquent
==============

[](#neo4j-eloquent)

[![Latest Version](https://camo.githubusercontent.com/72da6aae228dd4eb6796a3fa6db854d21ce98e0bfc4736cf6d35b3944f3d563a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f64776f6f646172642f6e656f346a2d656c6f7175656e742e737667)](https://packagist.org/packages/dwoodard/neo4j-eloquent)[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)

A Laravel package that provides an Eloquent-style API for Neo4j graph database interactions with schema-less, dynamic operations.

Features
--------

[](#features)

✅ **Schema-less Operations** - No predefined models required
✅ **Eloquent-style API** - Familiar Laravel query patterns
✅ **Multi-label Support** - Handle nodes with multiple labels
✅ **Relationship Traversal** - Fluent relationship navigation
✅ **Laravel Integration** - Seamless service provider integration
✅ **Model-based Approach** - Traditional Eloquent-style models
✅ **JSON Serialization** - Proper JSON encoding out of the box
✅ **Auto Service Injection** - No manual configuration required

Installation
------------

[](#installation)

Install the package via Composer:

```
composer require dwoodard/neo4j-eloquent
```

Publish the configuration file:

```
php artisan vendor:publish --provider="Neo4jEloquent\Laravel\Neo4jEloquentServiceProvider"
```

Configuration
-------------

[](#configuration)

Add your Neo4j connection details to your `.env` file:

```
NEO4J_HOST=localhost
NEO4J_PORT=7687
NEO4J_USERNAME=neo4j
NEO4J_PASSWORD=your-password
NEO4J_DATABASE=neo4j
NEO4J_LOG_QUERIES=false
NEO4J_AUTO_UUID=true
```

**That's it!** The package will automatically configure itself and inject the Neo4j service.

Usage
-----

[](#usage)

### Model-based Approach (Recommended)

[](#model-based-approach-recommended)

Create a model by extending the base `Model` class:

```
