Skip to content

Commit 5b68a3a

Browse files
fix empty password user
1 parent 28dd313 commit 5b68a3a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/material-stubs/app/Http/Controllers/UserController.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,10 @@ public function edit(User $user)
6363
*/
6464
public function update(UserRequest $request, User $user)
6565
{
66+
$hasPassword = $request->get('password');
6667
$user->update(
6768
$request->merge(['password' => Hash::make($request->get('password'))])
68-
->except([$request->get('password') ? '' : 'password']
69+
->except([$hasPassword ? '' : 'password']
6970
));
7071

7172
return redirect()->route('user.index')->withStatus(__('User successfully updated.'));

0 commit comments

Comments
 (0)