Simple QrCode
Laravel-friendly wrapper for generating QR codes as PNG, SVG, or EPS
Repository Health
Technical Analysis
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
GeneratorAPI (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
QrCodefacade 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
QrCodefacade - 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.
Used by 2 apps in this directory
Bagisto
Analytics · Ecommerce
Open-source Laravel eCommerce platform for building multi-vendor marketplaces, B2B stores, headless commerce, and AI-powered storefronts.
LinkStack
Marketing
Self-hosted, privacy-focused Linktree alternative with themes, analytics, and a drag-and-drop admin panel.