Vinelab / NeoEloquent

The Neo4j OGM for Laravel
MIT License
635 stars 200 forks source link

Works in Lumen #164

Closed asanluis closed 8 years ago

asanluis commented 8 years ago

Ok, its not an issue, but i'm tired and don't want to make a pull request. If you have problems in Lumen, you can do this:

In the class NeoEloquentServiceProvider: `class_alias('Vinelab\NeoEloquent\Eloquent\Model', 'NeoEloquent'); class_alias('Vinelab\NeoEloquent\Facade\Neo4jSchema', 'Neo4jSchema');

// $this->app->booting(function(){ // $loader = AliasLoader::getInstance(); // $loader->alias('NeoEloquent', 'Vinelab\NeoEloquent\Eloquent\Model'); // $loader->alias('Neo4jSchema', 'Vinelab\NeoEloquent\Facade\Neo4jSchema'); // }); `

In the bootstrap/app.php uncomment and put: ` $app->configure('database');

$app->withFacades();

$app->register(\Vinelab\NeoEloquent\NeoEloquentServiceProvider::class);`

And make the config folder with the database.php file, that looks something like this: return [ 'default' => 'neo4j', 'connections' => [ 'neo4j' => [ 'driver' => 'neo4j', 'host' => 'localhost', 'port' => '7474', 'username' => xxx 'password' => xxx ] ] ];

The las thing you hae to do is make your model: use NeoEloquent; class xxx extends NeoEloquent{ ....}

I also solved the migrations...tommorow i pull