fix: add validation to home contact form

The form wasn't previosly being validated, allowing spammers to proliferate and bypass the captcha.
This commit is contained in:
2022-03-31 16:45:38 +01:00
committed by Miguel Nogueira
parent d23820598f
commit a7c76ad7b8
2 changed files with 34 additions and 1 deletions

View File

@@ -0,0 +1,32 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class HomeContactRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'email' => 'required|email',
'msg' => 'required|string',
'captcha' => 'required|string'
];
}
}