- How do I install Quar for Laravel 11 or 12?
- Run `composer require tuncaybahadir/quar` in your project directory. Quar supports Laravel 10–13 and PHP 8.2–8.5 out of the box. No additional configuration is needed beyond Composer installation.
- Can I customize QR code colors and eye styles in Quar?
- Yes, Quar supports fluent method chaining for customization. Use methods like `color()`, `eye()`, `marker()`, and `gradient()` to adjust colors and eye styles (square, rounded, circle, or ring).
- Does Quar work with Laravel Blade templates?
- Absolutely. Generate a QR code in your controller or service, then pass it to Blade as a variable. Use `{{ $qr }}` directly in your view to render it inline, or embed it as an `<img>` tag.
- What Laravel and PHP versions does Quar support?
- Quar is fully compatible with Laravel 10, 11, 12, and 13, and PHP 8.2 through 8.5. It’s tested against these versions to ensure stability and performance.
- How do I save QR codes to storage instead of rendering them directly?
- Use the `save()` method to store QR codes as files in Laravel’s storage system. For example, `Quar::generate('text')->save(storage_path('app/public/qr.png'))` saves the QR to `storage/app/public/qr.png`.
- Are there any known issues with Quar’s underlying libraries?
- Quar relies on BaconQrCode, which has a known bug with logo margins. Use the `margin(1)` method as a workaround if integrating logos. Always test edge cases like complex payloads or custom styling.
- Can I generate QR codes asynchronously for better performance?
- Quar’s core generation is synchronous, but you can offload it to Laravel Queues for high-volume use. Dispatch a job with `Quar::generate()` and process it asynchronously to avoid blocking I/O.
- How do I add a logo or text overlay to a QR code?
- Use the `logo()` method to add a logo and `text()` for overlays. For logos, ensure proper sizing and margins with `margin(1)` to avoid cropping issues. Example: `Quar::generate('text')->logo(public_path('logo.png'))`.
- Is Quar secure for generating QR codes with user-provided data?
- Quar does not validate payloads for malicious content (e.g., phishing URLs or XSS). Sanitize inputs before generating QR codes, especially if they’re user-generated or used in sensitive contexts like authentication.
- What alternatives exist if Quar doesn’t meet my needs?
- For Laravel, consider `endroid/qr-code` (more customization options) or `bacon/bacon-qrcode` (direct library usage). For non-Laravel projects, use `endroid/qr-code` or `chillerlan/php-qrcode` independently.