chehc / neo-eloquent
Laravel 对 Neo4j 图数据库 REST 接口的包装
v2.0.1
2020-02-04 05:54 UTC
Requires
- php: >=7.2.0
- heydavid713/neo4jphp: 0.1.*
- illuminate/console: 6.*
- illuminate/database: 6.*
- illuminate/events: 6.*
- illuminate/pagination: 6.*
- illuminate/support: 6.*
- nesbot/carbon: ~2.0
Requires (Dev)
- mockery/mockery: 1.0
- phpunit/phpunit: ~6.0
This package is auto-updated.
Last update: 2024-09-24 03:33:49 UTC
README
Neo4j 图 Eloquent 驱动程序用于 Laravel。这是一个个人使用包,是从 https://github.com/Vinelab/NeoEloquent 克隆的。
快速参考
安装
将包添加到您的 composer.json
并运行 composer update
。
Laravel 6
6.x
{ "require": { "edwinfadilah/neoeloquent": "2.0.*" } }
Laravel 5
5.8
{ "require": { "edwinfadilah/neoeloquent": "1.7.*" } }
5.7
{ "require": { "edwinfadilah/neoeloquent": "1.6.*" } }
5.6
{ "require": { "edwinfadilah/neoeloquent": "1.5.*" } }
5.5
{ "require": { "edwinfadilah/neoeloquent": "1.4.*" } }
5.4
{ "require": { "edwinfadilah/neoeloquent": "1.3.*" } }
5.3
{ "require": { "edwinfadilah/neoeloquent": "1.2.*" } }
5.2
{ "require": { "edwinfadilah/neoeloquent": "1.1.*" } }
5.1
{ "require": { "edwinfadilah/neoeloquent": "1.0.*" } }
在 app/config/app.php
中添加服务提供者
'EdwinFadilah\NeoEloquent\NeoEloquentServiceProvider',
服务提供者将注册此包所需的所有类,并将 Model
类别别名为 NeoEloquent
,因此您可以在模型中简单地 扩展 NeoEloquent
。
配置
连接
在 app/config/database.php
中,或者在基于环境的配置情况下,在 app/config/[env]/database.php
中,将 neo4j
设置为默认连接
'default' => 'neo4j',
添加连接默认值
'connections' => [ 'neo4j' => [ 'driver' => 'neo4j', 'host' => 'localhost', 'port' => '7474', 'username' => null, 'password' => null, 'ssl' => false ] ]
迁移设置
如果您想使用迁移
- 创建文件夹
app/database/labels
- 修改
composer.json
并将app/database/labels
添加到classmap
数组中 - 运行
composer dump-autoload
文档
有关更多信息,请参阅其原始仓库: https://github.com/Vinelab/NeoEloquent