Skip to main content
The remaining built-in data types cover three everyday use cases that don’t fit neatly into contact or communication categories: connecting a device to a wireless network, dropping a pin on a map, and adding a calendar event — all with a single scan.

WiFi

QrCode::WiFi() produces a WIFI: scheme payload that iOS and Android camera apps parse natively. Scanning the code connects the device to the network without the user having to type the password.

Signature

string
required
The network SSID. Must not be empty.
string
The security protocol: WEP, WPA, WPA2, WPA3, or NOPASS. WPA2 and WPA3 are both normalised to WPA in the payload (as per the spec). Omit this key to let the package infer WPA when a password is provided, or NOPASS for open networks.
string
The network password. Omit for open (NOPASS) networks. Passing a password alongside NOPASS throws an InvalidWiFiArgumentException.
boolean
Set to true if the network SSID is hidden. Defaults to false.
WEP is deprecated and insecure. It is supported only for compatibility with legacy hardware. Use WPA or WPA2 for all new deployments.

Examples


Geo

QrCode::Geo() produces a geo: URI (RFC 5870). Scanning it opens the device’s default maps application with a pin at the specified coordinates and an optional location name.

Signature

float
required
Decimal latitude between -90 and 90. Values outside this range throw an InvalidGeoArgumentException.
float
required
Decimal longitude between -180 and 180. Values outside this range throw an InvalidGeoArgumentException.
string
An optional human-readable place name appended as a name query parameter.

Examples


CalendarEvent

QrCode::CalendarEvent() produces an iCalendar (RFC 5545) VCALENDAR payload. Scanning it prompts the device to add the event to the user’s calendar with all details pre-filled.

Signature

string
required
The event title. Must not be empty.
Carbon|DateTimeInterface|string|int
required
The event start date and time. Accepts a Carbon instance, any DateTimeInterface, a parseable date string, or a Unix timestamp integer.
Carbon|DateTimeInterface|string|int
required
The event end date and time. Must be strictly after start; otherwise an InvalidCalendarEventArgumentException is thrown.
string
An optional longer description of the event.
string
An optional event location string.
Per RFC 5545, the DTSTAMP field is set to the current UTC timestamp every time the payload is serialised. This means generating a QR code for the same event twice will produce different binary outputs and the result cannot be strictly cached by content hash. If you need a stable, reproducible QR code, generate it once, save the result to disk, and serve the saved file.

Examples

All timestamps are converted to UTC before being written into the payload, regardless of the timezone on the Carbon instance you pass in. Pass timezone-aware Carbon objects (e.g. Carbon::create(..., 'America/Chicago')) to ensure the event appears at the correct local time on the recipient’s device.