bothify("??######"); } public function passportNumber() { return $this->bothify("??#######"); } /** * National Personal Identity number (personas kods) * @link https://en.wikipedia.org/wiki/National_identification_number#Latvia * @param \DateTime $birthdate * @return string on format XXXXXX-XXXXX */ public function personalIdentityNumber(\DateTime $birthdate = null) { if (!$birthdate) { $birthdate = \Faker\Provider\DateTime::dateTimeThisCentury(); } $datePart = $birthdate->format('dmy'); $randomDigits = (string) static::numerify('####'); $checksum = Luhn::computeCheckDigit($datePart . $randomDigits); return $datePart . '-' . $randomDigits . $checksum; } }