-
Notifications
You must be signed in to change notification settings - Fork 456
Open
Description
I'm curious why using
$user = User::find(auth()->user()->id);
is wrong, and
$user = auth()->user();
is right in the unit test
but if I try on browser the method doing exactly the same (Name, email, password changed succesfully)
full code
// $user = User::find(auth()->user()->id);
$user = auth()->user();
$user->name = $request->input('name');
$user->email = $request->input('email');
// Also, update the password if it is set
if ($request->has('password')) {
$user->password = Hash::make($request->input('password'));
}
$user->save();
thanks for the help.
Metadata
Metadata
Assignees
Labels
No labels