Refactor ImportHtmlTemplates Command: Enhanced the command to process HTML templates by introducing a more structured approach for extracting header, footer, and section templates. Implemented dynamic placeholder replacements and improved asset path handling. Added support for light and dark logo settings in the database seeder, ensuring better logo management for different themes.

This commit is contained in:
Ümit Tunç
2025-12-27 07:57:48 +03:00
parent bacd5d7309
commit 8244bcc74c
2 changed files with 247 additions and 101 deletions
+40 -4
View File
@@ -585,6 +585,26 @@ class SettingSeeder extends Seeder
'is_public' => true,
'is_active' => true,
],
[
'key' => 'logo_light',
'value' => 'assets/img/logo-light.png',
'type' => 'file',
'group' => 'layout',
'label' => 'Light Logo',
'description' => 'Koyu zeminler için açık renkli logo',
'is_public' => true,
'is_active' => true,
],
[
'key' => 'logo_dark',
'value' => 'assets/img/logo-dark.png',
'type' => 'file',
'group' => 'layout',
'label' => 'Dark Logo',
'description' => 'Açık zeminler için koyu renkli logo',
'is_public' => true,
'is_active' => true,
],
[
'key' => 'favicon_path',
'value' => 'assets/img/favicon.ico',
@@ -1298,10 +1318,26 @@ class SettingSeeder extends Seeder
];
foreach ($settings as $setting) {
Setting::updateOrCreate(
['key' => $setting['key']],
$setting
);
$existing = Setting::where('key', $setting['key'])->first();
if ($existing) {
$updated = false;
// Sadece değişmişse güncelle
foreach ($setting as $field => $value) {
if ($existing->$field != $value) {
$updated = true;
break;
}
}
if ($updated) {
$existing->update($setting);
$this->command->info("Setting updated: " . $setting['key']);
} else {
$this->command->info("Setting unchanged: " . $setting['key']);
}
} else {
Setting::create($setting);
$this->command->info("Setting created: " . $setting['key']);
}
}
}
}