37 lines
1.3 KiB
PHP
37 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Requests;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class UpdateSettingsRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*
|
|
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'settings' => ['required', 'array'],
|
|
'settings.theme' => ['nullable', 'string', 'max:50'],
|
|
'settings.floatingLines' => ['nullable', 'array'],
|
|
'settings.appearance' => ['nullable', 'string', 'max:50'],
|
|
'settings.accentColor' => ['nullable', 'string', 'max:50'],
|
|
'settings.language' => ['nullable', 'string', 'max:10'],
|
|
'settings.emotionGradientStart' => ['nullable', 'string', 'max:20'],
|
|
'settings.emotionGradientEnd' => ['nullable', 'string', 'max:20'],
|
|
'settings.timelineZoom' => ['nullable', 'numeric', 'min:0.1', 'max:10'],
|
|
'settings.timelineScrollLeft' => ['nullable', 'numeric', 'min:0'],
|
|
'settings.showFps' => ['nullable', 'boolean'],
|
|
'settings.presets' => ['nullable', 'array'],
|
|
'settings.activePresetId' => ['nullable', 'string', 'max:100'],
|
|
];
|
|
}
|
|
}
|