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(1w ago)01↓100%MITPHPPHP ^8.2CI passing

Since Jun 1Pushed 1w 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 (2)Used By (0)

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

[](#octacraftsoc-qr-laravel)

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.

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. See [LICENSE](LICENSE).

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance98

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

8d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d901dbb43429272286e0193c6c2f0c09358e586a5daeac34eaac197772e60bb2?d=identicon)[octacrafts](/maintainers/octacrafts)

---

Top Contributors

[![WasifBoostzone](https://avatars.githubusercontent.com/u/275062263?v=4)](https://github.com/WasifBoostzone "WasifBoostzone (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

3325.1M337](/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.5k9.6k1](/packages/vinkius-labs-laravel-page-speed)[linkxtr/laravel-qrcode

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

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

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

90128.1k](/packages/emargareten-inertia-modal)[amirezaeb/heroqr

A Powerful QR Code Management Library For PHP

9812.8k](/packages/amirezaeb-heroqr)

PHPackages © 2026

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