Skip to content

Commit

Permalink
adding default label styles to package config file
Browse files Browse the repository at this point in the history
  • Loading branch information
2amjsouza committed Dec 5, 2023
1 parent 420d5aa commit b2f344c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
13 changes: 13 additions & 0 deletions config/2am-qrcode.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
]
];
6 changes: 3 additions & 3 deletions src/Factory/LaravelQrCodeFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')
));
}
}
Expand Down

0 comments on commit b2f344c

Please sign in to comment.