Skip to main content
Contact data types encode personal and professional details into a QR code that any modern smartphone camera app can parse and offer to save as a new contact. The package supports two standards: VCard (RFC 6350 / version 3.0) and MeCard (NTT DoCoMo format). Both let a user scan once and skip the manual entry entirely.

VCard

Use QrCode::VCard(array $config) to produce a vCard 3.0 payload. VCard is the most widely supported contact format across iOS, Android, and desktop mail clients, making it the safest default choice for business cards, event badges, and printed marketing materials.

Supported Keys

name
string
required
The full display name of the contact (FN field). This is the only required key.
firstName
string
The contact’s given name. Used alongside lastName to populate the structured N field.
lastName
string
The contact’s family name.
If firstName and lastName are provided, they will automatically construct the structured N field in the VCard, while name populates the FN (Formatted Name) field.
email
string
A general internet email address.
emailWork
string
A work-typed internet email address (EMAIL;type=INTERNET,WORK).
emailHome
string
A home-typed internet email address (EMAIL;type=INTERNET,HOME).
phone
string
A general phone number (TEL).
phoneWork
string
A work-typed phone number (TEL;type=WORK).
phoneHome
string
A home-typed phone number (TEL;type=HOME).
phoneCell
string
A mobile/cell phone number (TEL;type=CELL).
company
string
The organisation name (ORG).
job
string
The job title (TITLE).
role
string
The role within the organisation (ROLE).
address
string
A street address (ADR).
url
string
A personal or company website URL (URL).
note
string
A free-text note (NOTE).
birthday
string
Date of birth in YYYYMMDD format (BDAY).

Example

use Linkxtr\QrCode\Facades\QrCode;

// Minimal — name only
$qr = QrCode::VCard(['name' => 'Jane Smith']);

// Full business card
$qr = QrCode::VCard([
    'name'      => 'Jane Smith',
    'firstName' => 'Jane',
    'lastName'  => 'Smith',
    'email'     => 'jane@example.com',
    'emailWork' => 'jane.smith@acme.com',
    'phone'     => '+12025550170',
    'phoneCell' => '+12025550195',
    'company'   => 'Acme Inc.',
    'job'       => 'Software Engineer',
    'address'   => '123 Main St, Springfield, IL 62701',
    'url'       => 'https://janesmith.dev',
    'note'      => 'Met at Laracon 2025',
    'birthday'  => '19900315',
]);

// Render as SVG inline
echo QrCode::VCard([
    'name'    => 'Jane Smith',
    'email'   => 'jane@example.com',
    'phone'   => '+12025550170',
    'company' => 'Acme Inc.',
])->generate();
Always wrap in try/catch when using user-supplied data. The only hard requirement is a non-empty name; all other keys are optional.

MeCard

Use QrCode::MeCard(string $name, ...) to produce a MeCard payload. MeCard is a lighter-weight format originating from NTT DoCoMo and is prevalent in Japan and some Asian markets. It carries slightly fewer fields than vCard but produces a shorter payload, resulting in a less complex QR code.

Signature

QrCode::MeCard(
    string  $name,
    ?string $phone        = null,
    ?string $email        = null,
    ?string $url          = null,
    ?string $address      = null,
    ?string $reading      = null,  // Phonetic reading of the name (SOUND)
    ?string $nickname     = null,
    ?string $phone2       = null,
    ?string $phone3       = null,
    ?string $videoPhone   = null,
    ?string $note         = null,
    ?string $birthday     = null,  // YYYYMMDD format
    ?string $postOfficeBox = null,
)

Example

use Linkxtr\QrCode\Facades\QrCode;

// Basic
$qr = QrCode::MeCard('Jane Smith');

// With contact details
$qr = QrCode::MeCard(
    name:     'Jane Smith',
    phone:    '+12025550170',
    email:    'jane@example.com',
    url:      'https://janesmith.dev',
    address:  '123 Main St, Springfield, IL',
    note:     'Laracon 2025',
    birthday: '19900315',
);

// Render to a PNG file
QrCode::MeCard(
    name:  'Jane Smith',
    phone: '+12025550170',
    email: 'jane@example.com',
)->format('png')->size(400)->generate(storage_path('app/qrcodes/jane.png'));

VCard vs MeCard — Which Should You Use?

VCard 3.0MeCard
CompatibilityiOS, Android, Outlook, macOS — universally supportedExcellent on Android; supported on iOS 11+; less so on desktop
FieldsRich: multiple emails, phone types, role, birthday, notesCore fields only: name, phone, email, URL, address, note
Payload sizeLarger (more verbose)Smaller (shorter QR code at the same error-correction level)
Best forBusiness cards, event badges, marketing collateralSimple personal cards, space-constrained prints
When in doubt, choose VCard. It is more widely supported and handles multiple phone numbers and email addresses in a single payload.