statamic / eloquent-driver

Provides support for storing your Statamic data in a database, rather than flat files.
https://statamic.dev/tips/storing-content-in-a-database
MIT License
104 stars 73 forks source link

Preferences not saved in DB #141

Closed espenlg closed 5 months ago

espenlg commented 1 year ago

When changing the default settings and re-order the navigation it is stored in resources/preferences.yaml.

Maybe it is supposed to be this way? I can't decide.

ryanmitchell commented 1 year ago

As these are user related my personal feeling is they should be handled by the eloquent users support in core.

espenlg commented 1 year ago

I agree om the user settings, but what about the default settings 🤔

ryanmitchell commented 1 year ago

Yeah I suppose we could add a config option to store the default preferences in eloquent, it's a bit niche and Im not sure a lot of people would use it. It would just be a case of extending Statamic\Preferences\DefaultPreferences and changing the save/__construct methods.

Want to work on it @espenlg ?

espenlg commented 1 year ago

@ryanmitchell Sounds scary to say the least 😬 But I may give it a shot 👍

duncanmcclean commented 5 months ago

Like @ryanmitchell said, storing preferences in the database is probably a bit niche, I don't know how many developers would actually want to do that.

However, if you want to do it, it's fairly easy to do yourself. I've whipped up a Gist which gives you everything you need to store default preferences in the DB instead.