简体   繁体   English

使用Laravel5配置MongoDB

[英]Configuring MongoDB with Laravel5

Can any one know how to configure mongoDB with laravel5, there is a package 谁能知道如何使用laravel5配置mongoDB,有一个软件包

{
  "require": {
      "navruzm/lmongo": "*"
  }
}

But it work in laravel4, Is anyone configure it in laravel5 or used another alternative ? 但是它可以在laravel4中工作,有人在laravel5中对其进行配置还是使用了其他替代方法?

jenssegers laravel Mongo 詹森斯·拉拉韦尔·蒙戈

The dev branch of jenssegers will work with L5 but its dev branch so not to be relied on. jenssegers的dev分支将与L5一起使用,但不要依赖它的dev分支。

Also Laravel 5 is not officially released or stable yet so it would not be advised to do anything worthwhile with the current V5. 此外,Laravel 5尚未正式发布或稳定,因此建议不要使用当前的V5做任何值得做的事情。

Laravel Release Notes Laravel发行说明

Your require info will be as follows : 您的需求信息如下:

{
    "require": {
        "jenssegers/mongodb": "*"
    }
}

add in the service provider to your app.php 将服务提供商添加到您的app.php中

'Jenssegers\Mongodb\MongodbServiceProvider',

The service provider will register a mongodb database extension with the original database manager. 服务提供商将向原始数据库管理器注册mongodb数据库扩展。 There is no need to register additional facades or objects. 无需注册其他外观或对象。 When using mongodb connections, Laravel will automatically provide you with the corresponding mongodb objects. 使用mongodb连接时,Laravel将自动为您提供相应的mongodb对象。

Everything else should be as normal with L5 as with L4. L5的其他所有内容都应与L4一样正常。 More information on the installation and configuring is available at the development git repo. 开发git repo上提供了有关安装和配置的更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM