Files
fotospiel-app/app/Http/Requests/Tenant/NotificationPreferencesRequest.php
Codex Agent 79b209de9a Limit-Status im Upload-Flow anzeigen (Warnbanner + Sperrzustände).
Upload-Fehlercodes auswerten und freundliche Dialoge zeigen.
2025-11-01 19:50:17 +01:00

43 lines
954 B
PHP

<?php
namespace App\Http\Requests\Tenant;
use App\Services\Packages\TenantNotificationPreferences;
use Illuminate\Foundation\Http\FormRequest;
class NotificationPreferencesRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, mixed>
*/
public function rules(): array
{
$rules = [
'preferences' => ['required', 'array'],
];
foreach (array_keys(TenantNotificationPreferences::defaults()) as $key) {
$rules["preferences.{$key}"] = ['required', 'boolean'];
}
return $rules;
}
protected function prepareForValidation(): void
{
$this->merge([
'preferences' => $this->input('preferences', []),
]);
}
}