L
L
Loot2015-06-07 12:17:03
Laravel
Loot, 2015-06-07 12:17:03

Laravel 5 why are configs stored in .env?

Why in laravel configs are stored in .env file? and what is the config folder in the root for then? And after all, the .env file is available from the web, i.e. if you go to site.ru/.env , you can see all the configs, including the database

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
JhaoDa, 2015-06-07
@Cesavel

Firstly, it is very strange that your .env is accessible from the outside, because the root of the site should look into the public folder.
Secondly, .env stores important and host-dependent configs - keys to various services, users and passwords from the database, and so on.
Thirdly, the config folder contains all application configs, and takes important and host-dependent ones from .env. Nobody bothers you to delete the .env file and hard-code all the parameters into the appropriate files in the config folder. I also recommend reading what the documentation
says about this .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question