[英]Access to laravel .env file
Hi I am developing an application with laravel 5.5. 嗨,我正在使用laravel 5.5开发一个应用程序。 I want to build a setup similar to Wordpress, and I want to automatically save the database information to the .env file, so that's how I do it, or how to access the .env file.
我想构建一个类似于Wordpress的设置,我想自动将数据库信息保存到.env文件中,这样我就是这样做的,或者如何访问.env文件。
You can prepare the contents of the .env
file and save it: 您可以准备
.env
文件的内容并保存:
\File::put(base_path('.env'), $contents);
But I'd say it's a bad idea to do that. 但我会说这样做是个坏主意。 You should keep the data in DB or config files.
您应该将数据保存在DB或配置文件中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.