> ## Documentation Index
> Fetch the complete documentation index at: https://docs.linkx.tr/llms.txt
> Use this file to discover all available pages before exploring further.

# Contact QR Codes: VCard and MeCard

> Generate scannable contact QR codes with VCard 3.0 or MeCard format so users can save details directly to their address book.

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.

> [!NOTE]
>
> 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

```php theme={null}
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();
```

> [!NOTE]
>
> 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

```php theme={null}
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

```php theme={null}
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.0 | MeCard |
| - | - | - |
| **Compatibility** | iOS, Android, Outlook, macOS — universally supported | Excellent on Android; supported on iOS 11+; less so on desktop |
| **Fields** | Rich: multiple emails, phone types, role, birthday, notes | Core fields only: name, phone, email, URL, address, note |
| **Payload size** | Larger (more verbose) | Smaller (shorter QR code at the same error-correction level) |
| **Best for** | Business cards, event badges, marketing collateral | Simple personal cards, space-constrained prints |

> [!TIP]
>
> When in doubt, choose **VCard**. It is more widely supported and handles
> multiple phone numbers and email addresses in a single payload.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.