outl1ne / nova-settings

A Laravel Nova tool for editing custom settings using native Nova fields.
MIT License
274 stars 97 forks source link

Separate setting per user #106

Closed stardothosting closed 2 years ago

stardothosting commented 2 years ago

I think this was what was asked in #76 but its possible there was a misunderstanding there.

I'd like to save settings per-user. I have extended the model provided with this package and am associating user_id with settings that are saved but, and forgive me if I am doing something wrong, each save of settings just updates the existing row of the one setting that was defined.

This means every user in the system can just update the same "global" setting? I'd like a setting preference for each individual user (i.e. notification preferences). This package seems like it would be ideal tool (really don't like making nova components for every little thing) but I'm not clear if this is possible out of the box with nova-settings?

Tarpsvo commented 2 years ago

This is not possible out of the box. You would have to rework the core logic to use user_id <-> settings_key pairs instead of just setting keys.

stardothosting commented 2 years ago

Ah okay - no problem. Thanks for the quick response!