common/models/entities/User.php
public function generateOtp() {

		$this->otp = random_int( 100000, 999999 );

		$valid = DateUtil::getDateTime();
		$valid = strtotime( $valid ) + Yii::$app->core->getOtpValidity();

		$this->otpValidTill = DateUtil::getDateTimeFromMillis( $valid );

		return $this->otp;
	}
public function generateOtp() {

		$this->otp = random_int( 100000, 999999 );

		$valid = DateUtil::getDateTime();
		$valid = strtotime( $valid ) + Yii::$app->core->getOtpValidity();

		$this->otpValidTill = DateUtil::getDateTimeFromMillis( $valid );

		return $this->otp;
	}
public function generateOtp ( ) { $ this -> otp = random_int ( 100000 , 999999 ) ; $ valid = DateUtil :: getDateTime ( ) ; $ valid = strtotime ( $ valid ) + Yii :: $ app -> core -> getOtpValidity ( ) ; $ this -> otpValidTill = DateUtil :: getDateTimeFromMillis ( $ valid ) ; return $ this -> otp ; }
Generate and set 6 digit random OTP.

@return void
Generate and set 6 digit random OTP .