我有一个laravel应用程序和一个带流明的应用程序,它们都有不同的数据库。
当我通过邮递员向流明打电话时,它正在找不到自己的数据库。
但是当我使用ixudra/curl lumen从laravel进行卷曲调用时,尝试使用laravel项目中laravel/.env文件中编写的数据库名称,而不是lumen/.env 。 是因为配置都是用php全局缓存的,所以流明认为它已经加载了它并且正在使用laravel中的那个?
流明没有config文件夹我不能硬编码那里的值。
有任何想法吗??
I have an application with laravel and one with lumen, both have different databases.
When I make a post call via postman to lumen, it is unsing his own database.
But when I do a curl call from laravel with ixudra/curl lumen tries to use the database name that is written in the laravel/.env file from the laravel project and not the lumen/.env. Is it because both the config is cached globally with php so lumen think it has already loaded it and is using the one from laravel instead?
Lumen has no config folder I can't hardcode the value there.
Any ideas??
最满意答案
您可以在流明应用程序中创建配置文件夹,并从vendor/laravel/lumen-framework/config/database.php复制database.php文件,这样您就可以根据需要对数据库配置进行必要的更改。
You can create a config folder in your lumen app, and copy the database.php file from vendor/laravel/lumen-framework/config/database.php, this way you can make necessary changes to your database configuration, if required.
更多推荐
发布评论