我认为你们中的一些人可能已经尝试this将neo4j
与laravel 5
进行整合。这就是我做的:
我使用这个命令安装了laravel 5:
composer create-project laravel/laravel laravel5test dev-develop
它安装顺利,没有任何错误。
我浏览了wiki,将"endyjasmi/neo4j": "2.*"
添加到require
的{{1}}部分,然后运行composer.json
。它已成功安装,然后我补充说
composer update
到'EndyJasmi\Laravel\Neo4jServiceProvider'
的{{1}}部分。我没有添加外墙,因为我不打算使用它们。 (我希望添加外墙是可选的!)
然后我去了providers
,添加了
app/config/app.php
到app/config/database.php
数组。然后我给了默认值
/*
|--------------------------------------------------------------------------
| Neo4j Databases
|--------------------------------------------------------------------------
|
| Neo4j is an open source graph database which is
| very fast in traversing related data
|
*/
'neo4j' => [
'default' => 'development',
'profiles' => [
'development' => [
'scheme' => 'http',
'host' => 'localhost',
'port' => 7474,
'username' => '',
'password' => ''
]
]
]
然后我考虑测试所有这些修改,所以我通过使用启动本地php服务器
connections
这是我得到的错误:
'default' => 'development'
我在哪里犯错误?在php artisan serve
?还是在exception 'BadMethodCallException' with message 'Call to undefined method [bind]' in /home/ajay/Desktop/laravel5login/vendor/laravel/framework/src/Illuminate/Support/ServiceProvider.php:221
Stack trace:
#0 /home/ajay/Desktop/laravel5login/vendor/endyjasmi/neo4j/src/Laravel/Neo4jServiceProvider.php(43): Illuminate\Support\ServiceProvider->__call('bind', Array)
#1 /home/ajay/Desktop/laravel5login/vendor/endyjasmi/neo4j/src/Laravel/Neo4jServiceProvider.php(43): EndyJasmi\Laravel\Neo4jServiceProvider->bind('EndyJasmi\Neo4j...', 'EndyJasmi\Neo4j...')
#2 /home/ajay/Desktop/laravel5login/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(415): EndyJasmi\Laravel\Neo4jServiceProvider->register()
#3 /home/ajay/Desktop/laravel5login/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(536): Illuminate\Foundation\Application->register(Object(EndyJasmi\Laravel\Neo4jServiceProvider))
#4 /home/ajay/Desktop/laravel5login/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(518): Illuminate\Foundation\Application->registerDeferredProvider('EndyJasmi\Larav...', 'EndyJasmi\Neo4j...')
#5 /home/ajay/Desktop/laravel5login/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(492): Illuminate\Foundation\Application->loadDeferredProvider('EndyJasmi\Neo4j...')
#6 /home/ajay/Desktop/laravel5login/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(183): Illuminate\Foundation\Application->loadDeferredProviders()
#7 /home/ajay/Desktop/laravel5login/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(89): Illuminate\Foundation\Console\Kernel->bootstrap()
#8 /home/ajay/Desktop/laravel5login/artisan(34): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 {main}
?请帮帮我
答案 0 :(得分:4)
我建议你使用https://github.com/Vinelab/NeoEloquent。是使用Neo4J和Laravel 5的优秀软件包
答案 1 :(得分:0)
Lavarel 5有一些变化,你应该试试这个OGM,https://github.com/lrezek/Neo4Laravel。还要检查为Lavarel固定的拉力> 5