json(['name' => null], 200); } /** * Update the user's profile information. * * @param \App\Api\v1\Requests\UserUpdateRequest $request * @return \App\Api\v1\Resources\UserResource */ public function update(UserUpdateRequest $request) { $user = $request->user(); $validated = $request->validated(); if (!Hash::check( $request->password, Auth::user()->password) ) { return response()->json(['message' => __('errors.wrong_current_password')], 400); } if (!config('2fauth.config.isDemoApp') ) { tap($user)->update([ 'name' => $validated['name'], 'email' => $validated['email'], ]); } return new UserResource($user); } }