bauer-kirch/cwa-event-registration-url

This package is abandoned and no longer maintained. No replacement package was suggested.

Allows creating and reading Corona Warn App Check-In URLs

v1.0.1 2021-04-27 09:18 UTC

This package is auto-updated.

Last update: 2023-07-27 17:47:54 UTC


README

This PHP library allows generating Check-In URLs for the Corona Warn App which can then be used to generate a QR code from. Moreover, event details can be extracted from existing Check-In URLs.

This library does not generate a QR code image. A dedicated library for QR code generation can be used for that, either in PHP or client side using JavaScript. A QR code generated from the check-in URL will open the Corona Warn App on mobile devices.

Installation

composer require bauer-kirch/cwa-event-registration-url

Usage

Reading URLs

use BauerKirch\CoronaWarnAppEventRegistration\QRCodePayloadReader;

$url = 'https://e.coronawarn.app/?v=1#CAESR...';
$reader = new QRCodePayloadReader();
$result = $reader->readUrl($url);
echo $result->getDescription();

Generating URLs

use BauerKirch\CoronaWarnAppEventRegistration\LocationType;
use BauerKirch\CoronaWarnAppEventRegistration\QRCodePayloadGenerator;

$generator = new QRCodePayloadGenerator();
$url = $generator->generateQRCodeUrl(
    LocationType::permanentWorkplace(),
    'Bauer + Kirch GmbH',
    'Pascalstr. 57, 52076 Aachen',
    120 // default check-in time in minutes
);
echo $url;