Generator instance, keeping the original state intact. Chain as many calls as you need before calling generate() or any data-type method to produce your final QrCodeResult.
style()
The module style. Accepted values:
| Value | Description |
|---|---|
square | Standard filled squares (default) |
dot | Circular dots |
round | Squares with rounded corners |
Optional scaling factor for the module size, between
0.0 and 1.0. Useful
with dot style to add spacing between dots. Defaults to the renderer’s
built-in size.eye()
Accepted values:
| Value | Description |
|---|---|
square | Standard square outline (default) |
circle | Circular outer ring |
pointy | Square with pointed inner corners |
internalEye()
eye() to create composite eye designs.
Accepted values:
square, circle, pointy — same as eye().eyeColor()
The index of the eye to color. Accepted values:
0, 1, 2 (top-left,
top-right, bottom-left respectively).Color for the inner square of the eye. Pass a hex string (e.g.
'#e11d48') or an RGB array (e.g. [225, 29, 72]).Color for the outer ring of the eye. Accepts the same formats as
inner.
When null, the outer ring inherits the global foreground color set by
color().size()
Pixel dimensions for both width and height. The default from the package
config is
400.margin()
4 modules is recommended by the QR specification for reliable scanning.
Margin thickness in pixels. The package default is
4.format()
Accepted values:
| Value | Requires | Notes |
|---|---|---|
svg | — | Default. Vector format; no PHP extension required. |
png | ext-imagick or ext-gd | Raster format. Falls back to GD if Imagick is unavailable. |
webp | ext-imagick | Raster format. Requires Imagick. |
eps | — | PostScript vector. Image merging is not supported for EPS. |
encoding()
UTF-8, which handles most use cases including multibyte characters.
Any valid PHP character encoding string, such as
UTF-8, ISO-8859-1, or
Shift_JIS.errorCorrection()
Accepted values:
| Level | Recovery capacity | Typical use |
|---|---|---|
L | ~7% | Maximum data density; minimal redundancy |
M | ~15% | Balanced default for most use cases |
Q | ~25% | Good choice when embedding a logo |
H | ~30% | Best durability; use for printed materials |