ruangdeveloper / laravel-settings

Manage global or model specific setting for your laravel project
https://packagist.org/packages/ruangdeveloper/laravel-settings
MIT License
4 stars 0 forks source link

Fallback Option (Not Default?) #3

Open WorthLMS opened 5 months ago

WorthLMS commented 5 months ago

Anyway to create fallback order / option?

IE: Say we have User Settings, Location Settings, Global Settings and Defaults

On User -> attempt to get setting ('x')

Fallbacks: [ Location::class ]

Will attempt to look in Location -> ('x')

if not found, looks in global ('x')

if not found, looks in default?

kykurniawan commented 3 months ago

Hi @WorthLMS

Thanks for your suggestion about adding a fallback mechanism for settings (User -> Location -> Global -> Defaults). That’s a great idea!

Currently, the package doesn’t support this feature, but I agree it could be valuable. If I misunderstood your comment, please feel free to explain further. Otherwise, if you’re interested in contributing, I welcome any help to implement this feature. You can open a pull request or start a discussion if you’d like to collaborate.

Thanks again for your input!