| Total Complexity | 2 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | class UpdateUserProfile implements UpdatesUserProfileInformation |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * Validate and update the given user's profile information. |
||
| 13 | * |
||
| 14 | * @param mixed $user |
||
| 15 | * @param array $input |
||
| 16 | * @return void |
||
| 17 | */ |
||
| 18 | public function update($user, array $input) |
||
| 19 | { |
||
| 20 | Validator::make($input, [ |
||
| 21 | 'name' => ['required', 'string', 'max:255'], |
||
| 22 | 'city' => ['string', 'max:100'], |
||
| 23 | 'country_code' => ['string', 'size:2'], |
||
| 24 | ])->validateWithBag('profile'); |
||
| 25 | |||
| 26 | $user->forceFill(Arr::only($input, ['name', 'city', 'country_code']))->save(); |
||
| 27 | } |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Update the given verified user's profile information. |
||
| 31 | * |
||
| 32 | * @param mixed $user |
||
| 33 | * @param array $input |
||
| 34 | * @return void |
||
| 35 | */ |
||
| 36 | protected function updateVerifiedUser($user, array $input) |
||
| 45 | } |
||
| 46 | } |
||
| 47 |