only('name', 'email'); if ($password = $request->input('password')) { $data['password'] = Hash::make($password); } return response()->json(auth()->user()->update($data)); } }