Wie ja bekannt, nutze ich aktiv kein WSC, bei mir sieht die Abfrage ziemlich simpel aus:
PHP
<?php
namespace App\Http\Requests;
use App\Rules\IpSFS;
use Illuminate\Foundation\Http\FormRequest;
class SendContactMailRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @throws \Exception
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'name' => 'required|string|between:3,100',
'email' => 'required|email|max:100',
'text' => 'required|string|between:10,2000',
'ip' => [
'required',
'ip',
new IpSFS,
],
];
}
}
Alles anzeigen
Aber ansonsten kommt es halt auch darauf an, wie man das ganze einstellt und das die automatischen Maßnahmen sind (sperren, Admin muss überprüfen, etc)