lrezek / Arachnid4Laravel by lrezek

Arachnid OGM provider and facade for Laravel.
4
0
2
Package Data
Maintainer Username: lrezek
Maintainer Contact: lukas@miratronix.com (Lukas Rezek)
Package Create Date: 2014-09-05
Package Last Update: 2015-04-09
Home Page:
Language: PHP
License: MIT
Last Refreshed: 2024-04-30 15:04:39
Package Statistics
Total Downloads: 4
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 0
Total Watchers: 2
Total Forks: 1
Total Open Issues: 0

About

This is a service provider for Laravel 4.1 for the Arachnid OGM.

Installation

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

{
    "require": {
       "lrezek/arachnid4laravel": "dev-master"
    }
}

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

{
    "require": {
       "everyman/neo4jphp":"dev-master",
       "lrezek/arachnid":"dev-master"
    }
}

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:

'LRezek\Arachnid4Laravel\Providers\ArachnidServiceProvider',

And the facade to the facades:

'Arachnid' => 'LRezek\Arachnid4Laravel\Facades\ArachnidFacade',

Note: You can change the name of the facade (Arachnid) 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
        )

And set the default connection as follows:

'default' => 'neo4j',

Usage

Once this set-up is complete, you can use entities and do queries as shown in Arachnid. To call functions in the entity manager, simply use the facade you defined above. For example:

Arachnid::flush()