diff --git a/config/2am-qrcode.php b/config/2am-qrcode.php index 93ed10a..c81c1c8 100644 --- a/config/2am-qrcode.php +++ b/config/2am-qrcode.php @@ -91,4 +91,17 @@ 'b' => 0, 'a' => 100, ], + + /* + * ------------------------------------------------------------------------ + * QR Code Label Style + * + * Defines the default style for the QR Code label style + * ------------------------------------------------------------------------ + */ + 'label' => [ + 'fontPath' => null, + 'size' => 16, + 'align' => \Da\QrCode\Enums\Label::AlignCenter, + ] ]; \ No newline at end of file diff --git a/src/Factory/LaravelQrCodeFactory.php b/src/Factory/LaravelQrCodeFactory.php index fc9c85e..956f8f2 100644 --- a/src/Factory/LaravelQrCodeFactory.php +++ b/src/Factory/LaravelQrCodeFactory.php @@ -218,9 +218,9 @@ protected static function applyLabel(QrCodeInterface $qrCode, ?string $label = n if (! is_null($label)) { $qrCode->setLabel(new Label( $label, - $fontPath, - $size, - $alignment + $fontPath ?? config('2am-qrcode.label.fontPath'), + $size ?? config('2am-qrcode.label.size'), + $alignment ?? config('2am-qrcode.label.align') )); } }