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,31 @@
<?php
namespace App\Http\Requests\Preferences;
use App\Http\Requests\ApiFormRequest;
use App\Services\Preferences\PreferencesOptionsService;
use Illuminate\Validation\Rule;
class PreferencesUpsertRequest extends ApiFormRequest
{
public function authorize(): bool
{
return $this->user() !== null;
}
public function rules(): array
{
$options = app(PreferencesOptionsService::class);
return [
'receive_email_notifications' => ['nullable', 'boolean'],
'receive_sms_notifications' => ['nullable', 'boolean'],
'notification_email' => ['nullable', 'boolean'],
'notification_sms' => ['nullable', 'boolean'],
'theme' => ['nullable', 'string', Rule::in(['light', 'dark'])],
'language' => ['nullable', 'string', Rule::in(['en', 'fr', 'es'])],
'style_color' => ['nullable', 'string', Rule::in($options->styleOptions())],
'menu_color' => ['nullable', 'string', Rule::in($options->menuOptions())],
];
}
}