- How do I install picqer/php-barcode-generator in a Laravel app?
- Run composer require picqer/php-barcode-generator in your Laravel project. The package has no service provider, config file, or migrations, so installation is just the Composer dependency. Instantiate the appropriate generator class such as BarcodeGeneratorSVG or BarcodeGeneratorPNG where needed. Pin the version in composer.json and commit the lock file.
- Does picqer/php-barcode-generator work with Laravel 9, 10, 11, and 12?
- Yes, it is framework-independent and works with Laravel 9 through 12 on PHP 8.x via Composer. It does not depend on Laravel internals, so Laravel upgrades do not normally require package changes. Verify your PHP version and any GD requirement for PNG output in each runtime. Keep the package version pinned and covered by tests.
- Which barcode symbologies does picqer/php-barcode-generator support?
- It generates 1D barcodes including EAN, UPC, Code 128, Code 39, ITF, and more. It does not cover 2D symbologies such as QR codes, DataMatrix, or PDF417. Check the package documentation for the exact list before committing to label or compliance requirements. If you need 2D formats, plan for a second library or a different engine.
- Can picqer/php-barcode-generator generate QR codes or DataMatrix?
- No, picqer/php-barcode-generator is limited to 1D barcodes such as EAN, UPC, Code 128, Code 39, and ITF. QR codes, DataMatrix, and PDF417 require a different library or engine. If your roadmap includes GS1 labels or regulatory 2D formats, evaluate that requirement before standardizing on this package. You can keep the 1D renderer behind an interface and add a separate 2D renderer later.
- How do I generate SVG barcodes in Laravel with picqer/php-barcode-generator?
- Instantiate BarcodeGeneratorSVG, call getBarcode($value, $type), and return the SVG string with the correct image/svg+xml content type or embed it in a Blade view. SVG output is extension-free and preferable for print and PDF workflows when the PDF engine renders SVG reliably. Use a thin route or controller and avoid calling the library directly from models or Blade templates. Wrap it in an internal BarcodeRenderer contract for testability.
- Do I need the GD extension for picqer/php-barcode-generator PNG output?
- Yes, raster output such as PNG or JPG depends on the GD extension, so confirm ext-gd is installed in every runtime image, including queue workers and CLI commands. SVG output does not require GD and is often the better choice for print and PDF. For PDF and legacy email clients, generate PNG at 2x to 3x scale. Test the actual output on the scanners and printers you use.
- Is the LGPL-3.0 license of picqer/php-barcode-generator safe for commercial Laravel apps?
- LGPL-3.0 generally permits use in proprietary applications under the usual dynamic-linking interpretation, but PHP autoloading, PHAR bundling, and redistribution to on-premise customers need a legal opinion. Modifications to the library itself must be released under LGPL. The safe pattern is to use the package unmodified behind an internal adapter and keep your application code separate. Confirm the legal position for SaaS, on-premise distribution, and any PHAR packaging before shipping.
- Should I call picqer/php-barcode-generator directly in Laravel controllers or Blade templates?
- Prefer wrapping it behind an internal BarcodeRenderer or BarcodeService contract and calling that from controllers, jobs, or views. The package is a stateless rendering utility and should be treated as a commodity implementation detail, not a platform dependency. A wrapper gives you centralized config for symbology, dimensions, colors, and DPI, plus easier validation and tests. It also lets you swap to Zint or another engine later without touching domain code.
- How should I test barcode scan quality in a Laravel application?
- Test against the actual scanners and label printers used in operations, not just browser rendering. Include acceptance tests for payload validation, symbology selection, quiet zones, DPI, and output format. Generate SVG for print where supported, and high-DPI PNG where the PDF engine or legacy client requires raster. Assign ownership of the internal wrapper and scan-quality tests so regressions are caught before labels reach production.
- What are alternatives to picqer/php-barcode-generator for Laravel?
- Alternatives include Zint, other PHP barcode libraries, and external barcode APIs, depending on whether you need 1D only or 2D formats such as QR, DataMatrix, or PDF417. picqer is a good fit for simple 1D output with no Laravel coupling and SVG, PNG, JPG, or HTML rendering. Keep the adapter boundary so a later swap does not affect domain code. Evaluate licensing, symbology coverage, and PDF-engine SVG support before choosing.