QrCode::Email() generates a mailto: URI. When scanned, the device opens the default mail client with the recipient address, subject, body, CC, and BCC fields already populated.
$address, $cc, and $bcc values are validated as proper email addresses. Passing an invalid address throws an InvalidEmailArgumentException.
Example
PhoneNumber
QrCode::PhoneNumber() generates a tel: URI that opens the device dialler with the number pre-filled.
Example
Although the constructor accepts integers for convenience (e.g. when pulling
from a numeric database column), always prefer a string prefixed with
+ and
the country code to ensure the dialler opens correctly on every device.SMS
QrCode::SMS() generates an sms: URI. Scanning it opens the device’s messaging app with the recipient number and an optional pre-filled message body.
Example
QrCode::WhatsApp() generates a https://wa.me/ deep-link. Scanning it opens WhatsApp with a pre-selected conversation and an optional pre-filled message.
You can call it with either an array or positional arguments:
+ prefix is stripped automatically from the number before building the wa.me URL, as the WhatsApp API requires a bare numeric international number.
Example
Telegram
QrCode::Telegram() generates a https://t.me/ link pointing to a public Telegram profile or channel. Scanning it opens the Telegram app directly on the profile page.
@ symbols are stripped automatically, so both myChannel and @myChannel are accepted. Invalid usernames throw an InvalidTelegramArgumentException.
Example
This data type links to a public Telegram username. Private users or
channels without a public username cannot be encoded this way.