From 85408c4e775dba7c0802f2d928efd921d530bc5b Mon Sep 17 00:00:00 2001 From: Nicolas CARPi <3043706+NicolasCARPi@users.noreply.github.com> Date: Mon, 5 Jan 2026 14:17:41 +0100 Subject: [PATCH] doc: getting started: improve examples (#154) add example for default lib qr provider and add issuer too see #152 --- docs/getting-started.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/getting-started.md b/docs/getting-started.md index ae1612d..b826bfb 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -21,17 +21,20 @@ Example code: ```php use RobThree\Auth\TwoFactorAuth; +use RobThree\Auth\Providers\Qr\QRServerProvider; // if using library's provider use RobThree\Auth\Providers\Qr\BaconQrCodeProvider; // if using Bacon use RobThree\Auth\Providers\Qr\EndroidQrCodeProvider; // if using Endroid +// using the default Qr Code provider from the library +$tfa = new TwoFactorAuth(new QRServerProvider(), "Your app name"); // using Bacon -$tfa = new TwoFactorAuth(new BaconQrCodeProvider()); +$tfa = new TwoFactorAuth(new BaconQrCodeProvider(), "Your app name"); // using Endroid -$tfa = new TwoFactorAuth(new EndroidQrCodeProvider()); +$tfa = new TwoFactorAuth(new EndroidQrCodeProvider(), "Your app name"); // using a custom object implementing IQRCodeProvider interface -$tfa = new TwoFactorAuth(new MyQrCodeProvider()); +$tfa = new TwoFactorAuth(new MyQrCodeProvider(), "Your app name"); // using named argument and a variable -$tfa = new TwoFactorAuth(qrcodeprovider: $qrGenerator); +$tfa = new TwoFactorAuth(qrcodeprovider: $qrGenerator, issuer: "Your app name"); ``` ## 3. Shared secrets