PHPackages                             octacrafts/oc-qr-laravel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. octacrafts/oc-qr-laravel

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

octacrafts/oc-qr-laravel
========================

Laravel integration for octacrafts/oc-qr QR code generation

v1.0.0(1mo ago)02MITPHPPHP ^8.2CI passing

Since Jun 1Pushed 1mo agoCompare

[ Source](https://github.com/octacrafts/oc-qr-laravel)[ Packagist](https://packagist.org/packages/octacrafts/oc-qr-laravel)[ Docs](https://github.com/octacrafts/oc-qr-laravel)[ RSS](/packages/octacrafts-oc-qr-laravel/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (4)Versions (3)Used By (0)

octacrafts/oc-qr-laravel
========================

[](#octacraftsoc-qr-laravel)

[![License: MIT](https://camo.githubusercontent.com/08cef40a9105b6526ca22088bc514fbfdbc9aac1ddbf8d4e6c750e3a88a44dca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d626c75652e737667)](LICENSE)

Laravel integration for [octacrafts/oc-qr](https://github.com/octacrafts/oc-qr). This package is a thin adapter: all QR generation, encoding, masking, and rendering live in the core library.

Maintained by **[OctaCrafts](https://octacrafts.com)**.

This package follows the OctaCrafts **core-plus-wrapper** pattern: [octacrafts/oc-qr](https://github.com/octacrafts/oc-qr) is the framework-agnostic QR engine (ISO/IEC 18004); **octacrafts/oc-qr-laravel** adds Laravel service provider, facade, configuration, and dependency injection. For plain PHP or other PSR-compliant apps, use the core directly.

About OctaCrafts
----------------

[](#about-octacrafts)

[OctaCrafts](https://octacrafts.com) 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 &amp; Design** — modern, responsive, high-performance websites
- **SaaS &amp; ERP Solutions** — custom platforms that automate workflows and centralize operations
- **Mobile Apps Development** — scalable Android, iOS, and cross-platform applications
- **DevOps &amp; Deployment** — secure cloud infrastructure, automation, and monitoring
- **Web Maintenance** — ongoing security updates, backups, and technical support
- **Infographics &amp; Motion Graphics** — visual content and animations for clear communication

Beyond client projects, OctaCrafts maintains open-source PHP libraries on [GitHub @octacrafts](https://github.com/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.

Requirements
------------

[](#requirements)

- PHP 8.2+
- Laravel 11 or 12
- `ext-gd` (required by the core library for PNG output)

Installation
------------

[](#installation)

```
composer require octacrafts/oc-qr-laravel
```

The package auto-registers via Laravel package discovery. No manual provider registration is required.

### Publish configuration (optional)

[](#publish-configuration-optional)

```
php artisan vendor:publish --tag=oc-qr-config
```

Environment variables:

VariableDefaultDescription`OC_QR_SIZE``300`Default output size in pixels`OC_QR_MARGIN``4`Default quiet zone in modules`OC_QR_ERROR_CORRECTION``M``L`, `M`, `Q`, or `H``OC_QR_FORMAT``png``png` or `svg`Usage
-----

[](#usage)

### Facade

[](#facade)

```
use Octacrafts\QrLaravel\Facades\Qr;

$output = Qr::make('https://example.com')
    ->size(300)
    ->margin(4)
    ->png();

return response($output->content(), 200, [
    'Content-Type' => $output->contentType(),
]);
```

```
$svg = Qr::make('Hello World')->svg();
```

### Dependency injection

[](#dependency-injection)

```
use Octacrafts\QrLaravel\Contracts\QrManagerContract;

final class QrController
{
    public function __construct(
        private readonly QrManagerContract $qr,
    ) {}

    public function show(): \Illuminate\Http\Response
    {
        $output = $this->qr->make('https://example.com')->png();

        return response($output->content(), 200, [
            'Content-Type' => $output->contentType(),
        ]);
    }
}
```

### Advanced options

[](#advanced-options)

Use core domain types for full control. The fluent builder delegates to `Octacrafts\QrEngine\Core\QrBuilder`:

```
use Octacrafts\QrEngine\Domain\ErrorCorrectionLevel;
use Octacrafts\QrEngine\Domain\OutputFormat;

$output = Qr::make('payload')
    ->errorCorrection(ErrorCorrectionLevel::H)
    ->format(OutputFormat::Svg)
    ->generate();
```

For forced version, mask, or custom colors, use `QrEngine` from the core package directly.

Architecture
------------

[](#architecture)

```
Facade (Qr) → QrManager → FluentQrBuilder → octacrafts/oc-qr QrBuilder → QrEngine

```

For a detailed walkthrough from bootstrap to `RenderedOutput`, see [docs/flow.md](docs/flow.md).

Configuration is parsed once into `PackageConfig` and injected into `QrManager`. Avoid calling `config()` from package classes outside the service provider.

Extending
---------

[](#extending)

Rebind services in your application `AppServiceProvider` without modifying this package:

```
$this->app->singleton(\Octacrafts\QrEngine\Core\QrEngine::class, fn () => $customEngine);
```

Future Laravel-specific features (storage, response helpers, logo overlays) should implement `FluentQrContract` or wrap `RenderedOutput` after generation.

Development
-----------

[](#development)

Clone the repository and install dependencies:

```
composer install
composer test
```

Manual smoke test (writes files to the project root; gitignored):

```
vendor/bin/testbench tinker --execute="file_put_contents('manual-test-qr.png', \Octacrafts\QrLaravel\Facades\Qr::make('https://example.com')->png()->content());"
```

QR encoding correctness is covered by [octacrafts/oc-qr](https://github.com/octacrafts/oc-qr). This package only ships Laravel integration tests.

License
-------

[](#license)

MIT License. See [LICENSE](LICENSE) for details.

---

**[OctaCrafts](https://octacrafts.com)** — Scalable IT Systems &amp; AI-Driven Digital Ecosystems

[octacrafts.com](https://octacrafts.com) ·  · +1 (855) 424 4706

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance90

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

53d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/278240197?v=4)[octacrafts](/maintainers/octacrafts)[@octacrafts](https://github.com/octacrafts)

---

Top Contributors

[![WasifBoostzone](https://avatars.githubusercontent.com/u/275062263?v=4)](https://github.com/WasifBoostzone "WasifBoostzone (2 commits)")[![octacrafts](https://avatars.githubusercontent.com/u/278240197?v=4)](https://github.com/octacrafts "octacrafts (1 commits)")

---

Tags

qr codeqrlaraveloctacrafts

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/octacrafts-oc-qr-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/octacrafts-oc-qr-laravel/health.svg)](https://phpackages.com/packages/octacrafts-oc-qr-laravel)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.3M347](/packages/psalm-plugin-laravel)[renatomarinho/laravel-page-speed

Laravel Page Speed

2.5k1.7M11](/packages/renatomarinho-laravel-page-speed)[vinkius-labs/laravel-page-speed

Laravel Page Speed

2.5k12.5k1](/packages/vinkius-labs-laravel-page-speed)[emargareten/inertia-modal

Inertia Modal is a Laravel package that lets you implement backend-driven modal dialogs for Inertia apps.

90142.9k](/packages/emargareten-inertia-modal)[linkxtr/laravel-qrcode

A clean, modern, and easy-to-use QR code generator for Laravel

3720.4k](/packages/linkxtr-laravel-qrcode)[wearepixel/laravel-cart

A cart implementation for Laravel

1374.8k](/packages/wearepixel-laravel-cart)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
