Teren-app/app/Http/Requests/UpdateMailProfileRequest.php
2025-10-07 21:57:10 +02:00

33 lines
1.2 KiB
PHP

<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class UpdateMailProfileRequest extends FormRequest
{
public function authorize(): bool
{
return $this->user() && $this->user()->can('update', $this->route('mail_profile'));
}
public function rules(): array
{
return [
'name' => ['sometimes', 'required', 'string', 'max:190'],
'host' => ['sometimes', 'required', 'string', 'max:190'],
'port' => ['sometimes', 'required', 'integer', 'between:1,65535'],
'encryption' => ['nullable', 'in:ssl,tls,starttls'],
'username' => ['nullable', 'string', 'max:190'],
'password' => ['nullable', 'string', 'max:512'],
'from_address' => ['sometimes', 'required', 'email', 'max:190'],
'from_name' => ['nullable', 'string', 'max:190'],
'reply_to_address' => ['nullable', 'email', 'max:190'],
'reply_to_name' => ['nullable', 'string', 'max:190'],
'priority' => ['nullable', 'integer', 'between:0,65535'],
'max_daily_quota' => ['nullable', 'integer', 'min:0'],
'active' => ['nullable', 'boolean'],
];
}
}