Made it possible to disable captcha.
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user