forked from 2amjsouza/2am-qrcode-site-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
config/main: forms creation; applying options to qrcode generation
- Loading branch information
Showing
37 changed files
with
26,687 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
namespace App\Livewire\Traits; | ||
|
||
use App\Livewire\QrCodeComponent; | ||
use Da\QrCode\Contracts\LabelInterface; | ||
|
||
trait LabelTrait | ||
{ | ||
public string $label = ''; | ||
public int $size = 16; | ||
public string $align; | ||
|
||
public function applyLabel() | ||
{ | ||
$this->validate($this->getLabelRules()); | ||
|
||
$this->dispatch('apply-label', $this->label, $this->size, $this->align) | ||
->to(QrCodeComponent::class); | ||
} | ||
|
||
public function getLabelRules(): array | ||
{ | ||
return [ | ||
'label' => 'string|required', | ||
'align' => 'string|required', | ||
'size' => 'int|required|min:1' | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
namespace App\Livewire\Traits; | ||
|
||
use App\Livewire\QrCodeComponent; | ||
|
||
trait MarginTrait | ||
{ | ||
public int $margins = 15; | ||
|
||
public function applyMargin() | ||
{ | ||
$this->validate($this->getMarginRules()); | ||
|
||
$this->dispatch('apply-margin', $this->margins) | ||
->to(QrCodeComponent::class); | ||
} | ||
|
||
public function getMarginRules(): array | ||
{ | ||
return [ | ||
'margins' => 'int|required|min:0', | ||
]; | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.