2026-09-24 21:03:59 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Http\Requests;
|
|
|
|
|
|
2026-09-25 17:44:42 +03:00
|
|
|
use App\Rules\HCaptcha;
|
2026-09-24 21:03:59 +03:00
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
|
|
|
|
|
|
class ContactRequest extends FormRequest
|
|
|
|
|
{
|
|
|
|
|
public function authorize(): bool
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function rules(): array
|
|
|
|
|
{
|
|
|
|
|
return [
|
|
|
|
|
'name' => ['required', 'string', 'max:100'],
|
|
|
|
|
'email' => ['required', 'email', 'max:255'],
|
|
|
|
|
'message' => ['required', 'string', 'max:5000'],
|
2026-09-25 17:44:42 +03:00
|
|
|
'h-captcha-response' => ['bail', 'required', new HCaptcha],
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function messages(): array
|
|
|
|
|
{
|
|
|
|
|
return [
|
|
|
|
|
'h-captcha-response.required' => __('storefront.auth.captcha_failed'),
|
2026-09-24 21:03:59 +03:00
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
}
|