common/services/entities/UserService.php
public function forgotPassword( $user ) {

		$modelClass	= static::$modelClass;

		// Find existing user
		$userToUpdate = $modelClass::findById( $user->id );

		// Generate Token
		$userToUpdate->generateResetToken();
		$userToUpdate->generateOtp();

		// Update User
		$userToUpdate->update();

		return $userToUpdate;
	}
public function forgotPassword( $user ) {

		$modelClass	= static::$modelClass;

		// Find existing user
		$userToUpdate = $modelClass::findById( $user->id );

		// Generate Token
		$userToUpdate->generateResetToken();
		$userToUpdate->generateOtp();

		// Update User
		$userToUpdate->update();

		return $userToUpdate;
	}
public function forgotPassword ( $ user ) { $ modelClass = static :: $ modelClass ; // Find existing user $ userToUpdate = $ modelClass :: findById ( $ user -> id ) ; // Generate Token $ userToUpdate -> generateResetToken ( ) ; $ userToUpdate -> generateOtp ( ) ; // Update User $ userToUpdate -> update ( ) ; return $ userToUpdate ; }
The method generate a new reset token which can be used later to update user password.
@param User $user
@return User
The method generate a new reset token which can be used later to update user password .