laravel-setting icon indicating copy to clipboard operation
laravel-setting copied to clipboard

What’s the best way to handle multi value settings?

Open elfeffe opened this issue 2 years ago • 1 comments

For example, I have multiple currencies. How to have a setting called currencies, with multiple currencies inside?

elfeffe avatar Feb 04 '22 12:02 elfeffe

For example, I have multiple currencies. How to have a setting called currencies, with multiple currencies inside?

@elfeffe could you explain more with example please ?

Khaledsb avatar Aug 21 '22 13:08 Khaledsb

@elfeffe you can have an array called "currencies", and you add elements to it by calling it this way : setting('currencies.euro'), setting('currencies.dollar') etc... For example, i have an array here called "store_infos" with different values in it.

image

  • Updates work like this : setting('store_infos.name', $value)
  • Blade call like this : {{ setting('store_infos.name', $default) }}

Boudissa-Ihab avatar Dec 08 '22 10:12 Boudissa-Ihab

@elfeffe carbon (2)

Khaledsb avatar Dec 08 '22 12:12 Khaledsb

Thank you!

elfeffe avatar Dec 11 '22 13:12 elfeffe