Enhance settings form and model: Added support for array type in SettingForm with a new repeater field for managing key-value pairs. Updated Setting model to handle array values and modified localization files to include new keys for array-specific fields in both English and Turkish.

This commit is contained in:
Ümit Tunç
2025-10-23 15:31:26 -03:00
parent 7e269e6543
commit f38a9ccd9e
4 changed files with 69 additions and 2 deletions
+9
View File
@@ -18,6 +18,7 @@ class Setting extends Model
'value_file',
'value_date',
'value_datetime',
'value_array',
'type',
'group',
'label',
@@ -77,6 +78,14 @@ class Setting extends Model
$this->attributes['value'] = $value;
}
/**
* Set value from different field names
*/
public function setValueArrayAttribute($value)
{
$this->attributes['value'] = is_array($value) ? json_encode($value) : $value;
}
/**
* Get setting by key
*/