Add file type support in settings: Updated SettingForm to include a file upload field for settings, modified the Setting model to handle file values, and added a migration to accommodate the new file type. Enhanced localization files to support the new file type label in both English and Turkish.

This commit is contained in:
Ümit Tunç
2025-10-23 15:21:19 -03:00
parent 1bb06c7bd4
commit 5157fe46ba
5 changed files with 61 additions and 2 deletions
+10
View File
@@ -15,6 +15,7 @@ class Setting extends Model
'value',
'value_text',
'value_boolean',
'value_file',
'type',
'group',
'label',
@@ -50,6 +51,14 @@ class Setting extends Model
$this->attributes['value'] = $value ? '1' : '0';
}
/**
* Set value from different field names
*/
public function setValueFileAttribute($value)
{
$this->attributes['value'] = $value;
}
/**
* Get setting by key
*/
@@ -91,6 +100,7 @@ class Setting extends Model
'integer' => (int) $value,
'float' => (float) $value,
'array', 'json' => json_decode($value, true),
'file' => $value, // File path as string
default => $value,
};
}