From 28d5d24617aa7ef34d8bd52d3097752e043bdf40 Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 28 Nov 2025 19:05:19 +0000 Subject: [PATCH] Migration to handle skins --- ..._28_175733_add_link_colors_to_settings.php | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 database/migrations/2025_11_28_175733_add_link_colors_to_settings.php diff --git a/database/migrations/2025_11_28_175733_add_link_colors_to_settings.php b/database/migrations/2025_11_28_175733_add_link_colors_to_settings.php new file mode 100644 index 0000000000..3274fda20d --- /dev/null +++ b/database/migrations/2025_11_28_175733_add_link_colors_to_settings.php @@ -0,0 +1,86 @@ +select(['skin'])->first(); + + + Schema::table('settings', function (Blueprint $table) { + $table->string('link_dark_color')->after('header_color')->nullable()->default(null); + $table->string('link_light_color')->after('header_color')->nullable()->default(null); + }); + + + + $link_dark_color = '#36aff5'; + $link_light_color = '#3c8dbc'; + + switch ($setting->skin) { + case 'green': + $link_dark_color = '#00a65a'; + $link_light_color = '#00a65a'; + case 'green-dark': + $link_dark_color = '#00a65a'; + $link_light_color = '#00a65a'; + case 'red': + $link_dark_color = '#dd4b39'; + $link_light_color = '#dd4b39'; + case 'red-dark': + $link_dark_color = '#dd4b39'; + $link_light_color = '#dd4b39'; + case 'orange': + $link_dark_color = '#FF851B'; + $link_light_color = '#FF851B'; + case 'orange-dark': + $link_dark_color = '#FF8C00'; + $link_light_color = '#FF8C00'; + case 'black': + $link_dark_color = '#111'; + $link_light_color = '#111'; + case 'black-dark': + $link_dark_color = '#111'; + $link_light_color = '#111'; + case 'purple': + $link_dark_color = '#605ca8'; + $link_light_color = '#605ca8'; + case 'purple-dark': + $link_dark_color = '#605ca8'; + $link_light_color = '#605ca8'; + case 'yellow': + $link_dark_color = '#f39c12'; + $link_light_color = '#f39c12'; + case 'yellow-dark': + $link_dark_color = '#f39c12'; + $link_light_color = '#f39c12'; + case 'contrast': + $link_dark_color = '#86cbf2'; + $link_light_color = '#084d73'; + } + + DB::table('settings')->update(['link_light_color' => $link_light_color, 'link_dark_color' => $link_dark_color]); + + + + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('settings', function ($table) { + $table->dropColumn('link_dark_color'); + $table->dropColumn('link_light_color'); + }); + } +};