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
The network SSID. Must not be empty.
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.The network password. Omit for open (
NOPASS) networks. Passing a password
alongside NOPASS throws an InvalidWiFiArgumentException.Set to
true if the network SSID is hidden. Defaults to false.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
Decimal latitude between
-90 and 90. Values outside this range throw an
InvalidGeoArgumentException.Decimal longitude between
-180 and 180. Values outside this range throw an
InvalidGeoArgumentException.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
The event title. Must not be empty.
The event start date and time. Accepts a
Carbon instance, any
DateTimeInterface, a parseable date string, or a Unix timestamp integer.The event end date and time. Must be strictly after
start; otherwise an
InvalidCalendarEventArgumentException is thrown.An optional longer description of the event.
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.