2024-04-10 16:31:20 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Http\Requests\Fo;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
|
|
|
|
|
|
class SingleOptinRequest extends FormRequest
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Determine if the user is authorized to make this request.
|
|
|
|
|
*/
|
2025-06-19 17:37:29 +02:00
|
|
|
public function authorize(): bool
|
2024-04-10 16:31:20 +02:00
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get the validation rules that apply to the request.
|
|
|
|
|
*/
|
2025-06-19 17:37:29 +02:00
|
|
|
public function rules(): array
|
2024-04-10 16:31:20 +02:00
|
|
|
{
|
|
|
|
|
return [
|
|
|
|
|
'email' => 'required|email:rfc,dns,spoof',
|
2026-09-25 16:25:31 +02:00
|
|
|
'agree' => 'accepted',
|
2024-04-10 16:31:20 +02:00
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get the error messages for the defined validation rules.
|
|
|
|
|
*
|
|
|
|
|
* @return array<string, string>
|
|
|
|
|
*/
|
|
|
|
|
public function messages(): array
|
|
|
|
|
{
|
|
|
|
|
return [
|
|
|
|
|
'agree.accepted' => trans('Vous devez accepter de recevoir les newsletters du Club des Gaulois.'),
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
}
|