LaravelTest
35 строк · 911.0 Байт
1<?php
2
3namespace App\Http\Requests;
4
5use Illuminate\Foundation\Http\FormRequest;
6
7class UsersRequest extends FormRequest
8{
9/**
10* Determine if the user is authorized to make this request.
11*/
12public function authorize(): bool
13{
14return true;
15}
16
17/**
18* Get the validation rules that apply to the request.
19*
20* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
21*/
22public function rules(): array
23{
24return [
25'name' => 'required|string',
26'surname' => 'nullable|string',
27'patronimic' => 'nullable|string',
28'email' => 'required|string|unique:users,email',
29'password' => 'required|string|confirmed',
30'age' => 'nullable|integer',
31'gender' => 'nullable|integer',
32'address' => 'nullable|string',
33];
34}
35}