| Conditions | 3 | 
| Paths | 4 | 
| Total Lines | 14 | 
| Code Lines | 10 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Changes | 1 | ||
| Bugs | 0 | Features | 0 | 
| 1 | <?php | ||
| 17 | public function update(UpdateProfile $request) | ||
| 18 |     { | ||
| 19 | $validated = $request->validated(); | ||
| 20 | $user = Auth::user(); | ||
| 21 |         if ($validated['name']) { | ||
| 22 | $user->name = $validated['name']; | ||
| 23 |             Log::info('User#' . $user->id . ' changed its name to ' . $validated['name']); | ||
| 24 | } | ||
| 25 |         if ($validated['password']) { | ||
| 26 | $user->password = Hash::make($validated['password']); | ||
| 27 |             Log::info('User#' . $user->id . ' changed its password'); | ||
| 28 | } | ||
| 29 | $user->save(); | ||
| 30 |         return redirect()->route('profile.show')->with('status', 'Updated profile successfully!'); | ||
| 31 | } | ||
| 33 |