Skip to main content
Data types are purpose-built helpers that transform structured information — like a contact card, a cryptocurrency address, or a Wi-Fi credential — into the standardised QR payload format that scanner apps understand natively. Instead of assembling URI strings by hand, you call a named method and pass typed arguments; the package handles encoding, escaping, and spec compliance for you. Every data type method returns a QrCodeResult, which means you can chain rendering or saving calls directly onto the result without any intermediate steps.
All data type methods return a QrCodeResult instance, so you can immediately render or save the output: QrCode::Email('hi@example.com')->generate() works just as well as storing the result first.
All data types validate their inputs strictly and throw typed exceptions on invalid values. Always wrap user-supplied input in a try/catch block to handle validation errors gracefully.
use Linkxtr\QrCode\Facades\QrCode;
use Linkxtr\QrCode\Exceptions\InvalidDataTypeArgumentException;

try {
    $qr = QrCode::Email($request->input('email'));
} catch (InvalidDataTypeArgumentException $e) {
    // Handle validation error
}

Available Data Types

Contact

Encode full contact details as a scannable vCard or MeCard that can be saved directly to a phone’s address book.

Communication

Pre-fill email drafts, phone dials, SMS messages, WhatsApp chats, and Telegram profile links with a single scan.

Payment

Generate Bitcoin and Ethereum payment requests compatible with all major crypto wallets.

Other Types

Connect devices to Wi-Fi instantly, drop a pin on a map, or add a calendar event — all with a scan.

Quick Reference

MethodCategoryKey Parameters
QrCode::VCard(array $config)Contactname, email, phone, company, …
QrCode::MeCard(string $name, …)Contactname, phone, email, url, …
QrCode::Email(string $address, …)Communicationaddress, subject, body, cc, bcc
QrCode::PhoneNumber(string $phone)CommunicationE.164 phone number
QrCode::SMS(string $phoneNumber, …)CommunicationphoneNumber, message
QrCode::WhatsApp(string|array …)Communicationnumber, message
QrCode::Telegram(string $username)CommunicationTelegram username
QrCode::BTC(string $address, …)Paymentaddress, amount, label, message
QrCode::Ethereum(string $address, …)Paymentaddress, amount in ETH
QrCode::WiFi(array $credentials)Otherssid, encryption, password
QrCode::Geo(float $lat, float $lng, …)Otherlatitude, longitude, name
QrCode::CalendarEvent(array $attrs)Othersummary, start, end, …