supergnaw/luxiqr

Class for creating QR codes

0.0.1 2025-04-06 22:38 UTC

This package is auto-updated.

Last update: 2025-05-03 21:28:24 UTC


README

Reinventing the wheel, one Quick Response Code at a time.

This is a project simply to learn how QR code generation works. There are a plethora of QR code generators in the wild, so choose which one suits your needs best.

Primary Objectives

  • Understand how different data is encoded into a QR code
  • Learn how to do polynomial math for Reed-Solomon error correction
    • (This was a nightmare)
  • Implement settings customization for more control over the final generation
  • Have various different output options for maximum integration compatibility

Usage

Basic Usage

$qrCode = new LuxiQR(
    data: "https://github.com/supergnaw/LuxiQR",
    eccLevel: "H"
);

echo $qrCode->outputTable();

Factory Methods

Call

$qrCode = LuxiQR::Call(
    countryCode: "+1",
    phoneNumber: "(519) 867-5309",
    eccLevel: "H"
);

echo $qrCode->outputTable();

Email

$qrCode = LuxiQR::Email(
    email: "example@domain.com",
    subject: "Test Email",
    body: "This is an example.",
        eccLevel: "H"
);

echo $qrCode->outputTable();

URL

$qrCode = LuxiQR::URL(
    url: "https://www.google.com/",
    eccLevel: "H"
);

echo $qrCode->outputTable();

WiFi

$qrCode = LuxiQR::WiFi(
    ssid: "",
    encryption: "WPA",
    password: "correct horse battery staple",
    hidden: false,
    eccLevel: "H"
);

echo $qrCode->outputTable();

YouTube

$qrCode = LuxiQR::YouTube(
    url: "https://www.youtube.com/watch?v=w5ebcowAJD8",
    eccLevel: "H"
);

echo $qrCode->outputTable();

Various References