Update the theme

This commit is contained in:
DariusIII
2026-08-28 21:01:47 +02:00
parent 103406de59
commit 14498890ad
13 changed files with 528 additions and 74 deletions
+1 -1
View File
@@ -176,7 +176,7 @@ class ProfileController extends BasePageController
// Update color scheme
if ($request->has('color_scheme')) {
$schemeValue = $request->input('color_scheme');
if (in_array($schemeValue, ['blue', 'emerald', 'violet'], true)) {
if (in_array($schemeValue, ['blue', 'indigo', 'cyan', 'teal', 'emerald', 'violet', 'pink', 'rose', 'red', 'orange', 'amber'], true)) {
User::where('id', $userid)->update(['color_scheme' => $schemeValue]);
}
}
+1 -1
View File
@@ -20,7 +20,7 @@ class UpdateProfileRequest extends FormRequest
'email' => ['nullable', 'string', 'email', 'max:255', 'unique:users,email,'.$userId, new ValidEmailDomain],
'password' => ['nullable', 'string', 'min:8', 'confirmed', 'regex:/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,}$/'],
'theme_preference' => ['sometimes', 'in:light,dark,system'],
'color_scheme' => ['sometimes', 'in:blue,emerald,violet'],
'color_scheme' => ['sometimes', 'in:blue,indigo,cyan,teal,emerald,violet,pink,rose,red,orange,amber'],
];
}
}
+1 -1
View File
@@ -15,7 +15,7 @@ class UpdateThemeRequest extends FormRequest
{
return [
'theme_preference' => ['sometimes', 'in:light,dark,system'],
'color_scheme' => ['sometimes', 'in:blue,emerald,violet'],
'color_scheme' => ['sometimes', 'in:blue,indigo,cyan,teal,emerald,violet,pink,rose,red,orange,amber'],
];
}
}