Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the type of the input text size to numeric and check if the size is empty, return the default size #19

Merged
merged 5 commits into from
Feb 24, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
change the type of the input text size to numeric and check if the …
…size is empty, return the default size
  • Loading branch information
waelkhalifa committed Feb 24, 2024
commit 1134cdf8651d1c1c3f261e6c45df5302806fd141
3 changes: 2 additions & 1 deletion src/Facades/Qr.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public static function getFormSchema(string $statePath, string $optionsStatePath
TextInput::make('size')
->live()
->default(300)
->numeric()
->label(__('Size')),

Select::make('margin')
Expand Down Expand Up @@ -207,7 +208,7 @@ public static function output(?string $data = null, ?array $options = null): Htm
ColorManager::getColorAsArray($options, 'back_color')
);

$maker = $maker->size($options['size'] ?? static::getDefaultOptions()['size']);
$maker = $maker->size(! empty($options['size']) ? $options['size'] : static::getDefaultOptions()['size']);

if ($options['hasGradient']) {
if (filled($options['gradient_to']) && filled($options['gradient_form'])) {
Expand Down