lrezek / Neo4Laravel by lrezek

Hire voice OGM provider and facade for Laravel.
Package Data
Maintainer Username: lrezek
Maintainer Contact: (Lukas Rezek)
Package Create Date: 2014-02-11
Package Last Update: 2017-09-27
Home Page:
Language: PHP
License: MIT
Last Refreshed: 2020-05-23 15:06:37
Package Statistics
Total Downloads: 158
Monthly Downloads: 2
Daily Downloads: 0
Total Stars: 19
Total Watchers: 4
Total Forks: 3
Total Open Issues: 1


This is a service provider for Laravel 4.1 and 5 (thanks to hiencreativ) that uses Louis-Philippe Huberdeau's PHP OGM. It is based off of Levi Stanley's Neo4jPhpOgm, but updated to work with Laravel 4.1 and 5.


Add lrezek/neo4laravel as a requirement to composer.json:

    "require": {
       "lrezek/neo4laravel": "dev-master"

You may need to add the package dependencies as well, depending on your minimum-stability setting:

    "require": {

Update your packages with composer update or install with composer install.

Once Composer has updated your packages, you'll need to tell Lavarel about the service provider. Add the following to the providers in app/config/app.php:


And the facade to the facades:

'OGM' => 'LRezek\Neo4Laravel\Facades\Neo4LaravelFacade',

Note: You can change the name of the facade (OGM) to whatever you like.

Database Configuration

The Neo4J database configuration is autoloaded from app/config/database.php. To add a Neo4J connection, simply add the following to the connections parameter:

'neo4j' => array(
            'transport' => 'curl',
            'host' => 'localhost',
            'port' => '7474',
            'debug' => true,
            'proxy_dir' => '/tmp',
            'cache_prefix' => 'neo4j',
            'meta_data_cache' => 'array',
            'annotation_reader' => null,
            'username' => null,
            'password' => null,
            'pathfinder_algorithm' => null,
            'pathfinder_maxdepth' => null

You can also set the default connection as follows:

'default' => 'neo4j',


Once this set-up is complete, you can use entities and do queries as shown in Louis-Philippe Huberdeau's Neo4J PHP OGM. To call functions in the entity manager, simply use the facade you defined above. For example: