<?php

namespace App\Providers;

use App\Repositories\EventRepository;
use Illuminate\Http\Request;
use SimpleSoftwareIO\QrCode\Facades\QrCode;

class QrCodeUrlProvider {
    function __construct(private string $url) {
    }

    public function createQrCode(Request $request) {
        $event = new  EventRepository()->getByIdentifier($this->url, false)->toResource()->toArray($request);
        return
            QrCode::format('png')->size(300)->generate($event['url']);
    }
}
