| Conditions | 1 |
| Paths | 1 |
| Total Lines | 12 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | public function create(array $input) |
||
| 21 | { |
||
| 22 | Validator::make($input, [ |
||
| 23 | 'name' => ['required', 'string', 'max:255'], |
||
| 24 | 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], |
||
| 25 | 'password' => $this->passwordRules(), |
||
| 26 | ])->validate(); |
||
| 27 | |||
| 28 | return User::create([ |
||
| 29 | 'name' => $input['name'], |
||
| 30 | 'email' => $input['email'], |
||
| 31 | 'password' => Hash::make($input['password']), |
||
| 32 | ]); |
||
| 35 |