Teren-app/app/Http/Requests/TestSendSmsTemplateRequest.php
Simon Pocrnjič 930ac83604 SMS service
2025-10-24 21:39:10 +02:00

27 lines
779 B
PHP

<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class TestSendSmsTemplateRequest extends FormRequest
{
public function authorize(): bool
{
return $this->user()?->can('manage-settings') ?? false;
}
public function rules(): array
{
return [
'to' => ['required', 'string', 'max:30'],
'variables' => ['nullable', 'array'],
'profile_id' => ['nullable', 'integer', 'exists:sms_profiles,id'],
'sender_id' => ['nullable', 'integer', 'exists:sms_senders,id'],
'delivery_report' => ['sometimes', 'boolean'],
'country_code' => ['nullable', 'string', 'max:5'],
'custom_content' => ['nullable', 'string', 'max:1000'],
];
}
}