PHPackages                             mapo-89/laravel-qr-decoder - 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. mapo-89/laravel-qr-decoder

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

mapo-89/laravel-qr-decoder
==========================

A cross‑platform Laravel package for decoding QR codes from PNG images using Python

v1.1.1(5mo ago)12MITPHPPHP ^8.2CI passing

Since Jan 21Pushed 5mo agoCompare

[ Source](https://github.com/mapo-89/laravel-qr-decoder)[ Packagist](https://packagist.org/packages/mapo-89/laravel-qr-decoder)[ Docs](https://github.com/mapo-89/laravel-qr-decoder)[ RSS](/packages/mapo-89-laravel-qr-decoder/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (5)Versions (4)Used By (0)

Laravel QR Decoder
==================

[](#laravel-qr-decoder)

[![Latest Version on Packagist](https://camo.githubusercontent.com/66ddd284875e1da47cd8a62b15a8e7b9c7ccb1d5d9cbe2a69b382e5c5fa7985f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d61706f2d38392f6c61726176656c2d71722d6465636f6465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mapo-89/laravel-qr-decoder)[![Total Downloads](https://camo.githubusercontent.com/7412b0bf270d4b145b90a739d7d2c8927e463675be14b6559ec9b48bada161f3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d61706f2d38392f6c61726176656c2d71722d6465636f6465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mapo-89/laravel-qr-decoder)[![GitHub Actions](https://github.com/mapo-89/laravel-qr-decoder/actions/workflows/main.yml/badge.svg)](https://github.com/mapo-89/laravel-qr-decoder/actions/workflows/main.yml/badge.svg)

A cross‑platform Laravel package for decoding QR codes from PNG images using Python (`zxing-cpp`).

This package wraps a Python decoder inside a virtual environment and exposes a clean Laravel API. It works on **Windows and Linux** using OS‑specific wrapper scripts.

---

Features
--------

[](#features)

- ✅ Cross‑platform (Windows &amp; Linux)
- ✅ Python isolated via `venv`
- ✅ No global Python dependencies
- ✅ Secure execution via Symfony Process
- ✅ Works with logos / low‑contrast QR codes

---

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

[](#requirements)

- PHP &gt;= 8.2
- Laravel &gt;= 11
- Python &gt;= 3.13

---

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

[](#installation)

### Install the package (local / path repository)

[](#install-the-package-local--path-repository)

```
// composer.json
{
  "repositories": [
    {
      "type": "path",
      "url": "packages/laravel-qr-decoder"
    }
  ]
}
```

```
composer require mapo-89/laravel-qr-decoder
```

---

### Publish config

[](#publish-config)

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

---

### Configure Python path

[](#configure-python-path)

Edit `config/qr-decoder.php`:

```
return [
    'python_path' => base_path('python/qr-decoder'),
    'timeout' => 10,
];
```

### Run the installer (recommended)

[](#run-the-installer-recommended)

```
php artisan qr-decoder:install
```

This command will:

- Create a Python virtual environment in the configured path
- Install all required Python dependencies
- Work on Windows and Linux

Usage
-----

[](#usage)

This package does not provide controllers or views. It exposes a single service (`QrDecoder`) that can be used inside your application’s controllers, APIs, jobs or commands.

### Example Use Cases

[](#example-use-cases)

1. **Decode an already uploaded file on button click:**

```
use Mapo89\QrDecoder\QrDecoder;

$result = app(QrDecoder::class)->decode(
    storage_path('app/qr_uploaded_file.png')
);
```

2. **Upload a file and decode immediately:**

```
public function uploadAndDecode(Request $request, QrDecoder $decoder)
{
    $request->validate([
        'qrpng' => ['required', 'file', 'mimes:png', 'max:5120'],
    ]);

    // Store temporarily
    $path = $request->file('qrpng')->store('qr-decoder');
    $fullPath = storage_path('app/private/' . $path);

    try {
        $result = $decoder->decode($fullPath);
    } catch (\Throwable $e) {
        $result = null;
        // Handle error if needed
    } finally {
        if (file_exists($fullPath)) {
            @unlink($fullPath);
        }
    }

    return response()->json(['result' => $result]);
}
```

> Note: The controller should live in your application, not in this package. If you need a UI, build it in your application or in a separate package that depends on this one.

### Dependency Injection

[](#dependency-injection)

```
public function decode(QrDecoder $decoder)
{
    return $decoder->decode($path);
}
```

Configuration
-------------

[](#configuration)

```
return [
    'python_path' => base_path('python/qr-decoder'),
    'timeout' => 10,
];
```

---

Directory Structure
-------------------

[](#directory-structure)

```
laravel-qr-decoder/
├── src/
│   ├── QrDecoder.php
│   ├── QrDecoderFacade.php
│   └── QrDecoderServiceProvider.php
│
├── python/
│   ├── decode_qr.py
│   ├── requirements.txt
│   ├── run_qr_decoder
│   ├── run_qr_decoder.bat
│   └── venv/
│
├── config/
│   └── qr-decoder.php
│
├── composer.json
└── README.md

```

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Manuel Postler](https://github.com/mapo-89)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

Laravel Package Boilerplate
---------------------------

[](#laravel-package-boilerplate)

This package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance71

Regular maintenance activity

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity49

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

Every ~0 days

Total

3

Last Release

162d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/72ebd5bd16b28366468c5f9cdafe5350f343eaa054995d00f4b4640c5c27767b?d=identicon)[mapo-89](/maintainers/mapo-89)

---

Top Contributors

[![mapo-89](https://avatars.githubusercontent.com/u/118180259?v=4)](https://github.com/mapo-89 "mapo-89 (9 commits)")

---

Tags

mapo-89laravel-qr-decoder

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/mapo-89-laravel-qr-decoder/health.svg)

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

###  Alternatives

[laravel/horizon

Dashboard and code-driven configuration for Laravel queues.

4.2k95.4M300](/packages/laravel-horizon)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[illuminate/queue

The Illuminate Queue package.

21332.6M1.6k](/packages/illuminate-queue)[illuminate/console

The Illuminate Console package.

13046.0M6.4k](/packages/illuminate-console)[illuminate/process

The Illuminate Process package.

44869.2k99](/packages/illuminate-process)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)

PHPackages © 2026

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