Download the PHP package octacrafts/oc-qr without Composer
On this page you can find all versions of the php package octacrafts/oc-qr. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package oc-qr
OC-QR
octacrafts/oc-qr — A framework-agnostic PHP library for generating scannable QR codes (ISO/IEC 18004).
Maintained by OctaCrafts.
Pure PHP core with no Laravel or Symfony dependency. Use it in any PHP 8.2+ project, or wrap it in a Laravel package for your ecosystem.
About OctaCrafts
OctaCrafts is a global IT systems and software engineering company that builds scalable digital ecosystems for businesses worldwide. From idea to launch, the team delivers enterprise-grade solutions focused on long-term growth, performance, and reliability.
What we do:
- Web Development & Design — modern, responsive, high-performance websites
- SaaS & ERP Solutions — custom platforms that automate workflows and centralize operations
- Mobile Apps Development — scalable Android, iOS, and cross-platform applications
- DevOps & Deployment — secure cloud infrastructure, automation, and monitoring
- Web Maintenance — ongoing security updates, backups, and technical support
- Infographics & Motion Graphics — visual content and animations for clear communication
Beyond client projects, OctaCrafts maintains open-source PHP libraries under the oc/* package family on GitHub @octacrafts. Each ecosystem follows a core-plus-wrapper pattern: framework-agnostic cores for plain PHP and any PSR-compliant app, with dedicated integrations for popular frameworks.
octacrafts/oc-qr is the framework-agnostic core for ISO/IEC 18004 QR code generation. Framework-specific wrappers can build on this package for Laravel, Symfony, and other stacks.
Features
- ISO/IEC 18004–compliant matrix generation (versions 1–40)
- Automatic encoding mode selection: numeric, alphanumeric, and byte (mixed-mode)
- Kanji and ECI encoders for extended payloads
- Reed–Solomon error correction (levels L, M, Q, H)
- Optimal mask pattern selection (8 patterns, penalty scoring)
- PNG and SVG output
- Clean architecture: pipeline stages, interfaces, and swappable components
Requirements
| Requirement | Notes |
|---|---|
| PHP | ^8.2 |
| ext-gd | Required for PNG output |
| ext-json | Required |
SVG output does not require GD.
Installation
Quick start
SVG
Return an HTTP response (e.g. Slim, Laravel route)
API reference (QrBuilder)
| Method | Description | Default |
|---|---|---|
QrBuilder::create(string $content) |
Build a QR from text or URL | — |
errorCorrection(ErrorCorrectionLevel $level) |
Error correction level | M |
size(int $pixels) |
Output image size in pixels | 300 |
margin(int $modules) |
Quiet zone (white border) in modules; use 4 or more for reliable scanning |
4 |
format(OutputFormat $format) |
OutputFormat::Png or OutputFormat::Svg |
PNG |
generate() |
Returns RenderedOutput |
— |
Error correction levels
| Level | Enum | Typical use |
|---|---|---|
| L (~7%) | ErrorCorrectionLevel::L |
Clean prints, max data capacity |
| M (~15%) | ErrorCorrectionLevel::M |
Default — general URLs and text |
| Q (~25%) | ErrorCorrectionLevel::Q |
Logos, slight damage |
| H (~30%) | ErrorCorrectionLevel::H |
Smallest logo overlay, harsh environments |
RenderedOutput
Advanced usage
For custom colors, forced QR version, or mask pattern, use QrEngine directly:
Version and mask are chosen automatically when omitted.
Architecture
Dependencies flow inward; the public entry point is QrBuilder (or QrEngine for full control).
| Layer | Responsibility |
|---|---|
| Core | QrBuilder, QrEngine, generation pipeline |
| Encoder | Numeric, alphanumeric, byte, kanji, ECI; mixed-mode segmentation |
| Correction | Reed–Solomon, block split, codeword interleaving |
| Generator | Matrix, finder/timing/alignment patterns, data placement |
| Masking | Eight mask patterns, penalty rules, best-mask selection |
| Output | PNG (ext-gd) and SVG renderers |
Extension points live under Octacrafts\QrEngine\Contracts\ for custom encoders, renderers, or pipeline stages.
Laravel integration
This package does not ship Laravel bindings. For a Laravel app, create a thin wrapper package (service provider + facade) that depends on octacrafts/oc-qr and delegates to QrBuilder or QrEngine.
Development
Generate sample files locally:
Outputs are written to examples/output/ (gitignored).
License
MIT License. See LICENSE for details.
OctaCrafts — Scalable IT Systems & AI-Driven Digital Ecosystems
octacrafts.com · [email protected] · +1 (855) 424 4706
All versions of oc-qr with dependencies
ext-gd Version *
ext-json Version *