Enhance settings management: Added support for new form types including color picker, code editor, rich editor, markdown editor, tags input, checkbox list, radio buttons, toggle buttons, and slider in the SettingForm. Updated the Setting model to handle these new types and modified the migration to include them in the type enum. Enhanced localization files to support new type labels in both English and Turkish.

This commit is contained in:
Ümit Tunç
2025-10-29 15:47:48 -03:00
parent 36e54107e4
commit ef743e0d03
6 changed files with 414 additions and 3 deletions
@@ -0,0 +1,60 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('settings', function (Blueprint $table) {
$table->enum('type', [
'string',
'text',
'boolean',
'integer',
'float',
'array',
'json',
'file',
'date',
'datetime',
'color_picker',
'code_editor',
'rich_editor',
'markdown_editor',
'tags_input',
'checkbox_list',
'radio',
'toggle_buttons',
'slider',
'key_value',
])->default('string')->change();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('settings', function (Blueprint $table) {
$table->enum('type', [
'string',
'text',
'boolean',
'integer',
'float',
'array',
'json',
'file',
'date',
'datetime',
])->default('string')->change();
});
}
};