PHPackages                             denisgold/neoeloquent - 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. denisgold/neoeloquent

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

denisgold/neoeloquent
=====================

Laravel wrapper for the Neo4j graph database REST interface

1.6.0(8y ago)238[1 PRs](https://github.com/DenisGold/NeoEloquent/pulls)MITPHPPHP &gt;=5.6.4

Since May 9Pushed 8y ago1 watchersCompare

[ Source](https://github.com/DenisGold/NeoEloquent)[ Packagist](https://packagist.org/packages/denisgold/neoeloquent)[ RSS](/packages/denisgold-neoeloquent/feed)WikiDiscussions 1.5.5 Synced yesterday

READMEChangelog (7)Dependencies (8)Versions (55)Used By (0)

[![SensioLabsInsight](https://camo.githubusercontent.com/9a01127f45e73b2f599133bc41d8c0474b6ac5159eee1b35e44099a11e83caa9/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f34366436333266382d366233632d343434362d613264342d6332323762613463663337332f6269672e706e67)](https://insight.sensiolabs.com/projects/46d632f8-6b3c-4446-a2d4-c227ba4cf373)

[![Build Status](https://camo.githubusercontent.com/780719514804f6a76404294c889137339d2c72bcbb0d2e8665d59c6cccb1fab6/68747470733a2f2f7472617669732d63692e6f72672f56696e656c61622f4e656f456c6f7175656e742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Vinelab/NeoEloquent)

NeoEloquent
===========

[](#neoeloquent)

Neo4j Graph Eloquent Driver for Laravel

Chat &amp; Support
------------------

[](#chat--support)

Join the [Official Neo4j Slack Group](https://neo4j.com/blog/public-neo4j-users-slack-group/) and use the #neo4j-php channel.

Quick Reference
---------------

[](#quick-reference)

- [Installation](#installation)
- [Configuration](#configuration)
- [Models](#models)
- [Relationships](#relationships)
- [Edges](#edges)
- [Migration](#migration)
- [Schema](#schema)
- [Aggregates](#aggregates)
- [Only in Neo](#only-in-neo)
- [Things To Avoid](#avoid)

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

[](#installation)

Add the package to your `composer.json` and run `composer update`.

### Laravel 5

[](#laravel-5)

#### 5.4

[](#54)

```
{
    "require": {
        "denisgold/neoeloquent": "1.5.*"
    }
}
```

#### 5.3

[](#53)

```
{
    "require": {
        "denisgold/neoeloquent": "1.4.*"
    }
}
```

#### 5.2

[](#52)

```
{
    "require": {
        "denisgold/neoeloquent": "1.3.*"
    }
}
```

#### 5.1

[](#51)

```
{
    "require": {
        "denisgold/neoeloquent": "1.2.*"
    }
}
```

#### 5.0

[](#50)

```
{
    "require": {
        "denisgold/neoeloquent": "1.2.5"
    }
}
```

### Laravel 4

[](#laravel-4)

```
{
    "require": {
        "denisgold/neoeloquent": "1.1.*"
    }
}
```

Add the service provider in `app/config/app.php`:

```
'Vinelab\NeoEloquent\NeoEloquentServiceProvider',
```

The service provider will register all the required classes for this package and will also alias the `Model` class to `NeoEloquent` so you can simply `extend NeoEloquent` in your models.

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

[](#configuration)

### Connection

[](#connection)

in `app/config/database.php` or in case of an environment-based configuration `app/config/[env]/database.php`make `neo4j` your default connection:

```
'default' => 'neo4j',
```

Add the connection defaults:

```
'connections' => [
    'neo4j' => [
        'driver' => 'neo4j',
        'host'   => 'localhost',
        'port'   => '7474',
        'username' => null,
        'password' => null
    ]
]
```

### Lumen

[](#lumen)

For Lumen you need to create a new folder called `config` in the application root and there add a file called `database.php`. There you will add the following code.

```
