Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature req] Define fields in config file (PHP) #74

Open
tabacitu opened this issue Jul 8, 2018 · 3 comments
Open

[Feature req] Define fields in config file (PHP) #74

tabacitu opened this issue Jul 8, 2018 · 3 comments

Comments

@tabacitu
Copy link
Member

tabacitu commented Jul 8, 2018

@eduardoarandah was saying on Gitter:

Settings manager should default from a regular config/settings file
Because adding settings to a production app is pain
No only settings values, also fields definitions.
Right now, code goes to repository and settings fields definitions don’t because they live in database.
Defaulting from regular config file also gives us the power of .env file, caching, etc

At first I didn’t agree, but now I think he may be onto something. It would be A LOT easier to define each Setting in PHP, not JSON in the db. Then Setting::get() would get the value from the DB, if it exists, otherwise it would fall back to the default in the configuration file.

@eduardoarandah
Copy link
Contributor

Yes. Exactly that.
Simply overriding config/settings.php file

Also config/settings.php has the power to default to .env file and being cached

@niladam
Copy link

niladam commented Jul 16, 2018

@tabacitu I think that would be a great addition to this -- somewhat underused package. It would make changing settings a breeze -- with a 'default' being created/added/generated by the developer -- and also allowing the 'managers' to be able to change the settings on the fly. I'm guessing a little work could be do to further extend this say to even provide you with markdown templates (ie: welcome email, password reset wording and so on);

Just my 2 cents :)

@Laravel-Backpack Laravel-Backpack deleted a comment from ruwad-co Mar 15, 2022
@dkwiebe
Copy link

dkwiebe commented Aug 3, 2022

This isn't exactly what the original author was looking for but I have a little code that overrides the PHP config files from the database on boot. It's dependent on this pull request (#91) but I can post an example if it would be useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

4 participants