ldc-agis/app/Http/Requests/Fo/JoinusRequest.php
2023-12-19 15:09:12 +00:00

45 lines
1.4 KiB
PHP

<?php
namespace App\Http\Requests\Fo;
use App\Lib\Helpers\ToolboxHelper;
use Illuminate\Foundation\Http\FormRequest;
class JoinusRequest extends FormRequest
{
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
ToolboxHelper::validateRecaptcha($this, \config('services.google.recaptcha.version'));
return [
'last_name' => 'required|string|between:3,255',
'first_name' => 'required|string|between:3,255',
'email' => 'required|email:rfc,strict,dns,spoof,filter|max:255',
'phone' => 'required|numeric|min:0',
'message' => 'required|string|between:3,500',
"file" => "sometimes|nullable|mimes:pdf|max:10000"
];
}
/**
* Get custom attributes for validator errors.
*
* @return array
*/
public function attributes(): array
{
return [
'first_name' => trans('validation.attributes.first_name'),
'last_name' => trans('validation.attributes.last_name'),
'email' => trans('validation.attributes.email'),
'phone' => trans('validation.attributes.phone'),
'message' => trans('validation.attributes.message'),
'file' => trans('validation.attributes.file'),
];
}
}