davide cucurnia
2024-01-30 9f6455d9b12bda65377e8501e00557982be9ff36
commit | author | age
9f6455 1 <?php
DC 2
3 namespace App\Http\Requests;
4
5 use Illuminate\Http\Exceptions\HttpResponseException;
6 use Illuminate\Contracts\Validation\Validator;
7 use Illuminate\Foundation\Http\FormRequest;
8
9 class SendMailSend extends FormRequest
10 {
11     /**
12      * Determine if the user is authorized to make this request.
13      *
14      * @return bool
15      */
16     public function authorize()
17     {
18         return true;
19     }
20
21     protected function failedValidation(Validator $validator) {
22         throw new HttpResponseException(response()->json($validator->errors(), 422));
23     }
24
25     /**
26      * Get the validation rules that apply to the request.
27      *
28      * @return array<string, mixed>
29      */
30     public function rules()
31     {
32         return [
33             'request_mail_id' => 'required|string|max:255',
34         ];
35     }
36
37     /**
38      * Handle a passed validation attempt.
39      */
40     protected function passedValidation(): void
41     {
42         return;
43     }
44
45 }