Lumen - mongodb - jenssegers/laravel-mongodb - postman(流明 - mongodb - jenssegers/laravel-mongodb - 邮递员)
问题描述
我已经在我的 wamp 上安装了 mongodb,C:wamp64inmongodbmongodb.3.4in,我已经在路径中添加了 mongodb,并在必要时创建了 windows 服务来启动它.我已经通过composer安装了lumen,之后我安装了:
i have install mongodb on my wamp, C:wamp64inmongodbmongodb.3.4in, i have add mongodb in the path, and create windows service to launch it when necessary. I have install lumen through composer, and after that i have install:
- "laravel/lumen-framework": "5.3.*",
- "barryvdh/laravel-ide-helper": "v2.2.1",
- jenssegers/laravel-mongodb:v3.1.3"
- jenssegers/mongodb-session":v1.1.0"
最后我已经在我的 wamp php 上安装了 mongodb.dll 并在 php.ini 中添加了 extension=php_mongodb.dll.现在 mongodb 上的扩展是活跃的.
Finaly i have install mongodb.dll on my wamp php and add extension=php_mongodb.dll inside the php.ini. And now the extension on mongodb is active.
这是我的用户类:
这是我的迁移
这是 .env 文件
我已经在根应用程序中创建了配置目录,并且我已经添加了一个 database.php 配置文件:
i have create config directory in the root app, and i have add a database.php config file:
我已经启用了 eloquent、facades 和 jessenger 服务提供者.所以这是我的 boostrap/app.php:
I have enable eloquent, facades and jessenger Service provider. so this is my boostrap/app.php:
这是我的 UsersTableSeeder:
Here is my UsersTableSeeder:
我已经启动了 artisan migrate:install 然后 artisan migrate 最后是 artisan db:seed 似乎没问题,这是 mongo 内部的结果:
I have launch the artisan migrate:install then artisan migrate and finally artisan db:seed and it seems to be ok, here is the result inside mongo:
然后我创建了一个用户控制器
Then i have create a UserController
最后更新我的路由/web.php
And finally update my routes/web.php
我已经启动邮递员,以便我可以测试我的应用程序,只有 /api 工作,所有其他路线都给我同样的错误
I have launch postman, so that i could test my app, only /api work, all the other route give me the same error
有人可以帮我解决这个问题吗?
Openssl 和 curl 在我的 wamp php 中处于活动状态.
Openssl and curl are active in my wamp php.
推荐答案
我已经解决了问题,在我的 .env 中,我有:
I have solve the problem, in my .env i was having:
但在我的项目中没有为它们配置,所以当我将其更改为
but in my project no configuration for them, so when i have change it into
现在一切正常.
这篇关于流明 - mongodb - jenssegers/laravel-mongodb - 邮递员的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!