Simple QrCode

Laravel-friendly wrapper for generating QR codes as PNG, SVG, or EPS

Library
Composer
v4.2.0
2,903stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
50/100Fair
Development Activity0
Maintenance20
Community80
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
67/100Good
Architecture66
Code Quality68
Innovation55
Learning Curve78

Simple QrCode is a PHP library that wraps BaconQrCode to give Laravel applications (and plain PHP projects) an easy, fluent interface for generating QR codes. It handles the encoding details of turning arbitrary data — URLs, plain text, contact cards, Wi-Fi credentials — into scannable QR images, exposing options for size, color, error-correction level, embedded logos/merges, and output format.

The package registers a Laravel service provider and facade (QrCode::size(200)->generate('text')) for zero-config use in Laravel apps, while remaining usable outside Laravel since its core generator only depends on bacon/bacon-qr-code and the GD or Imagick PHP extensions for rendering. It has long been one of the most widely installed QR-generation packages in the Laravel ecosystem, though development has slowed in recent years relative to its peak activity.

What You Get

  • A fluent Generator API (QrCode::size(200)->color(255,0,0)->generate('data')) for building QR codes with chained options
  • Multiple output formats (PNG, SVG, EPS) via the underlying BaconQrCode encoder
  • A Laravel service provider and QrCode facade for zero-config use inside Laravel controllers and Blade views
  • Logo/image merging (ImageMerge.php) to embed a brand logo inside the generated QR code
  • Structured data-type helpers (DataTypes/) for common QR payloads such as vCards and Wi-Fi network credentials

Common Use Cases

  • Generating QR codes for URLs, coupons, or event tickets directly in a Laravel Blade view via the QrCode facade
  • Embedding a company logo inside generated QR codes for branded marketing materials
  • Producing vCard or Wi-Fi credential QR codes so users can scan to add a contact or join a network
  • Rendering QR codes as inline SVG for print-quality output without relying on the GD/Imagick raster pipeline

Under The Hood

Architecture Generator.php is the library’s core class, exposing a fluent builder over BaconQrCode’s Writer/Renderer classes to configure size, margin, color, error-correction level, and output format before encoding the QR matrix; QrCodeServiceProvider.php and Facades/ wire a QrCode facade into Laravel’s container so the generator is resolvable without manual instantiation. Image.php implements PNG/SVG/EPS rendering backends (choosing GD or Imagick depending on what’s installed), and ImageMerge.php overlays a supplied logo image onto the finished QR code by manipulating pixel data at the image-backend level. DataTypes/ provides small value classes (e.g. for vCard/Wi-Fi payloads) that format structured data into the QR-encodable string BaconQrCode expects. Tech Stack Requires PHP 7.2/8.0+ and the ext-gd extension (with ext-imagick suggested for PNG rendering), depends on bacon/bacon-qr-code ^2.0 for the actual QR encoding algorithm, and optionally on illuminate/support for Laravel integration — the core generator works without Laravel installed. Code Quality Tests cover GeneratorTest, ImageTest, and ImageMergeTest plus a dedicated DataTypes test directory and a tests/Images fixture directory for output comparison, run via PHPUnit ~9 with Mockery for mocking; however, the project’s last commit and release predate this snapshot by roughly two years, so recent PHP/Laravel version compatibility has not been actively re-verified. API Design The fluent, chainable QrCode::size()->color()->generate() style keeps common usage compact and readable, closely following Laravel’s conventional facade pattern, though advanced features (logo merging, custom data types) require reading the package docs since they aren’t self-evident from the fluent API alone.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search