add all controllers logic

This commit is contained in:
root
2026-03-11 17:53:15 -04:00
parent 3e6c577085
commit 2ef71cc92b
421 changed files with 12009 additions and 5211 deletions
@@ -0,0 +1,48 @@
<?php
namespace App\Services\Preferences;
class PreferencesOptionsService
{
public function defaultPreferences(): array
{
return [
'receive_email_notifications' => true,
'receive_sms_notifications' => true,
'theme' => 'light',
'language' => 'en',
'style_color' => 'blue',
'menu_color' => 'white',
];
}
public function styleOptions(): array
{
return ['blue', 'green', 'red', 'orange', 'gray', 'black', 'white'];
}
public function menuOptions(): array
{
return ['white', 'gray', 'black', 'blue', 'green'];
}
public function normalizeStyle(?string $style): ?string
{
if (!$style) {
return null;
}
$style = trim($style);
return in_array($style, $this->styleOptions(), true) ? $style : null;
}
public function normalizeMenu(?string $menu): ?string
{
if (!$menu) {
return null;
}
$menu = trim($menu);
return in_array($menu, $this->menuOptions(), true) ? $menu : null;
}
}