Skip to main content
The Laravel QR Code package gives you fine-grained control over the visual appearance of every QR code you generate. You can change the shape of individual data modules, the look of the three positional eyes, output dimensions, surrounding margin, file format, and text encoding — all through a fluent chainable API.

Module Style

The module style controls the shape of every small data block that makes up the body of the QR code. Pass a style string (or the Style enum) to style().
The style() method accepts both a plain string (e.g. 'dot') and the Linkxtr\QrCode\Enums\Style enum case (e.g. Style::DOT). Both forms are equivalent.

Eye Style

The three large positional squares in the corners of every QR code are called eyes. Use eye() to set their outer shape.

Internal (Composite) Eye Style

Each positional eye is made of two parts: an outer frame and an inner marker. By default both share the same style set by eye(). Call internalEye() to style the inner marker independently, giving you composite eyes.
internalEye() accepts the same values as eye(): 'square', 'circle', and 'pointy'.

Size and Margin

Control the pixel dimensions and quiet zone around the code with size() and margin().
  • size(int $size) — Total width and height in pixels. Default: 400.
  • margin(int $margin) — Quiet-zone thickness in modules. Default: 4.

Output Format

Use format() to choose the image format of the generated QR code.
When saving to a file, make sure the filename extension matches the chosen format. A mismatch (e.g. qr.png with format('svg')) will produce a file with incorrect content.

Encoding

By default the package encodes text as UTF-8, which handles the vast majority of use cases. Override this with encoding() when your payload uses a different character set.

Putting It All Together

Chain any combination of style options before calling generate().

Colors

Apply RGB, CMYK, grayscale, gradients, and per-eye color overrides.

Image Merge

Embed a logo or image into the center of your QR code.