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:
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user