NewWe open-sourced 50+ Laravel packages
Custom AI apps, agents and automation — Roundly ConsultingRoundly
All packages
QR for Laravel

Without the facade

The facade is the shortest form and the recommended default, not the only one. Its root is the RoundlyConsulting\Qr\Contracts\QrFactory contract, bound as a singleton to RoundlyConsulting\Qr\QrManager (app(QrManager::class) resolves the same instance). Type-hint the contract for the identical API as an explicit dependency:

use RoundlyConsulting\Qr\Contracts\QrFactory;
use RoundlyConsulting\Qr\PendingQr;

final class TableQrController
{
    public function __construct(private QrFactory $qr) {}

    public function __invoke(Table $table): PendingQr
    {
        abort_unless($this->qr->fits(route('menu', $table)), 422);

        return $this->qr->url(route('menu', $table))->size(240);
    }
}

Every method in the facade table is on the contract with the same signature, so switching between Qr::url(…) and $this->qr->url(…) changes nothing else.

No action classes

QR encoding is stateless, deterministic computation, so the manager serves it directly — there are no action classes to compose into your own jobs or commands. Call the contract from them instead.

QrManager also has public translator(), encode(), render() and encoderFits() methods. They exist only for PendingQr, carry @internal and are not on the contract or the facade — don’t call them from application code.

Show your open-source love

This package is free and MIT-licensed. If it saves you time, a one-off donation or a Patreon membership keeps it maintained, tested and documented.

More ways to support, including crypto

By donating, you agree to our donation terms.

Want this built into your product?

We integrate our packages into custom Laravel and AI builds. Tell us what you're working on and we'll reply within 48 hours.