简体   繁体   中英

Access to laravel .env file

Hi I am developing an application with 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.

You can prepare the contents of the .env file and save it:

\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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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