@@ 58-65 (lines=8) @@ | ||
55 | * @param array $data |
|
56 | * @return \Illuminate\Contracts\Validation\Validator |
|
57 | */ |
|
58 | protected function validator(array $data) |
|
59 | { |
|
60 | return Validator::make($data, [ |
|
61 | 'name' => ['required', 'string', 'max:255'], |
|
62 | 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], |
|
63 | 'password' => ['required', 'string', 'min:8', 'confirmed'], |
|
64 | ]); |
|
65 | } |
|
66 | ||
67 | /** |
|
68 | * Create a new user instance after a valid registration. |
@@ 25-33 (lines=9) @@ | ||
22 | * |
|
23 | * @return array |
|
24 | */ |
|
25 | public function rules() |
|
26 | { |
|
27 | return [ |
|
28 | 'name' => ['required', 'string'], |
|
29 | 'email' => ['required', 'string', 'unique:users'], |
|
30 | 'password' => ['required', 'string', 'min:8', 'confirmed'], |
|
31 | 'role_id' => ['required', 'string', 'exists:roles,id'], |
|
32 | ]; |
|
33 | } |
|
34 | ||
35 | /** |
|
36 | * Get custom messages for validator errors. |