Made it possible to disable captcha.

This commit is contained in:
2024-07-26 22:13:14 +05:00
parent a5e3c5ed25
commit 8bc4c0d8d0
7 changed files with 40 additions and 14 deletions

View File

@@ -32,12 +32,17 @@ final class SendRequest extends FormRequest implements FormRequestDto
*/
public function rules(): array
{
return [
$rules = [
'name' => ['nullable', 'string', 'max:255'],
'email' => ['nullable', 'string', 'max:255', 'email'],
'message' => ['required', 'string', 'max:5000'],
'captcha-verified' => ['captcha'],
];
if (config('app.captcha', false)) {
$rules['captcha-verified'] = ['captcha'];
}
return $rules;
}
public function getDto(): Send