R
R
rustem_ck2015-10-23 11:54:08
Laravel
rustem_ck, 2015-10-23 11:54:08

How to modify Laravel 5 configuration files?

I want to edit the configuration via the WEB, hence it is interesting: how exactly to save the settings programmatically?
What is a good practice to save/change the values ​​of laravel config files?
For myself, I see two options:
-Storage in .env of all values? (then how to save to env-file?)
-Storage in app/config/*.php (how to save settings there?)
PS. Do not suggest a way:
Display all the settings, and change the necessary, and then overwrite the configuration file.
Interested, it is the change that is necessary, and not all together .
P.P.S. Config::set() - saves only at the moment of the current connection, thus not affecting the configuration file.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alex Wells, 2015-10-26
@Alex_Wells

You don't need to take everything out. It's easier to use Setting packages, sobsno there and write down the values ​​used. And overwriting config files is a game)))

D
Dmitry Evgrafovich, 2015-10-23
@Tantacula

https://github.com/daftspunk/laravel-config-writer just don't know if it works now or not. In general, rarely changed settings are stored in configs - you are unlikely to need to change, for example, data for accessing the database or transfer the application to test mode on a live application. For everything else, it's probably better to use a separate table in the database.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question