Skip to main content
Data type methods are shorthand helpers that format a structured payload according to the relevant standard and immediately pass it to generate(), returning a QrCodeResult directly. You can chain any styling methods before calling a data type method.
Every data type method validates its inputs and throws a subclass of InvalidDataTypeArgumentException when something is wrong (empty required field, invalid format, etc.). Wrap calls that consume dynamic user input in a try/catch block.

Email()

Generate a mailto: QR code. The address, cc, and bcc values are validated with FILTER_VALIDATE_EMAIL; an invalid value throws InvalidEmailArgumentException.
string
required
The primary recipient email address. Must be a valid email.
string | null
Pre-filled subject line. Defaults to null.
string | null
Pre-filled message body. Defaults to null.
string | null
Carbon copy address. Must be a valid email when provided.
string | null
Blind carbon copy address. Must be a valid email when provided.

PhoneNumber()

Generate a tel: QR code that opens the device dialler.
string
required
The phone number to dial, including country code (e.g. +12025551234).

SMS()

Generate an sms: QR code that opens the device SMS app.
string | int | float
required
The recipient phone number, ideally in E.164 format (e.g. +12025551234).
string | null
Pre-filled SMS message text. Defaults to null.

Geo()

Generate a geo: QR code encoding a geographic coordinate. Scanners open the device map application at the given location.
float
required
Latitude in decimal degrees (e.g. 37.7749).
float
required
Longitude in decimal degrees (e.g. -122.4194).
string
Optional human-readable place name. Defaults to an empty string.

WiFi()

Generate a WiFi network configuration QR code. Scanning it lets devices join the network without manually entering credentials.
array
required
An associative array describing the network:
WEP encryption is deprecated and cryptographically broken. It is supported for legacy device compatibility only. Use WPA or WPA2 wherever possible.

BTC()

Generate a Bitcoin payment request QR code using the bitcoin: URI scheme (BIP 21).
string
required
The Bitcoin wallet address. Must be a non-empty string.
float | string
required
The requested amount in BTC (e.g. 0.005). Must be a non-negative numeric value. Pass as a string for very small amounts to avoid floating-point precision issues.
string | null
Human-readable label for the payment destination (maps to the label query parameter).
string | null
Note attached to the payment request (maps to the message query parameter).
string | null
URL the wallet should redirect to after the transaction is broadcast (maps to the r query parameter).

Ethereum()

Generate an Ethereum payment request QR code using the ethereum: URI scheme (ERC-67).
string
required
The Ethereum wallet address (typically a 0x… checksummed address).
int | float | string | null
The requested amount in ETH. Omit or pass null for an amount-agnostic address QR code.

VCard()

Generate a vCard 3.0 QR code for contact sharing.
array
required
An associative array of contact properties:

MeCard()

Generate a MeCard QR code — a lighter contact format popular in Japan and supported by most mobile QR scanners. You may also pass a single associative array using these parameter names as keys.
string
required
The contact’s full name. Must not be empty.
string | null
Primary phone number.
string | null
Email address.
string | null
Website URL.
string | null
Postal address.
string | null
Phonetic reading of the name (SOUND field).
string | null
Nickname (NICKNAME field).
string | null
Secondary phone number.
string | null
Tertiary phone number.
string | null
Video-call number (TEL-AV field).
string | null
Free-text note.
string | null
Birthday in YYYYMMDD format.
string | null
PO box (POBOX field).

CalendarEvent()

Generate a vCalendar (iCalendar / .ics) QR code for a single event. Scanners open the native calendar application and pre-fill a new event.
array
required
Per RFC 5545, the generated iCalendar payload includes a DTSTAMP property set to the current UTC timestamp at the moment of generation. Two calls for the same event will therefore produce different binary output and cannot be byte-for-byte cached. Generate CalendarEvent QR codes at request time rather than caching the raw bytes.

WhatsApp()

Generate a https://wa.me/ deep-link QR code that opens a WhatsApp chat. You may also pass a single associative array using phoneNumber and message as keys. The leading + is stripped automatically.
string | int | float
required
The recipient phone number, ideally in E.164 format (e.g. +12025551234). Must not be empty.
string | null
Pre-filled message text. Defaults to null.

Telegram()

Generate a https://t.me/ deep-link QR code that opens a Telegram profile or channel.
string
required
The Telegram username. The leading @ is stripped automatically if present. Must be 5–32 characters long, start with a letter, and contain only letters, digits, and underscores — following Telegram’s username rules. You can also pass an associative array with a username key.

Chaining styling with data types

Because all styling methods return a cloned Generator, you can apply size, color, and style options before calling any data type method: