Skip to content

Commit

Permalink
Cast type to enum
Browse files Browse the repository at this point in the history
  • Loading branch information
rpungello committed Dec 19, 2023
1 parent 412fd16 commit aed9f1e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Models/LabelBarcode.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class LabelBarcode extends Model
'y_pos' => 'float',
'width' => 'float',
'height' => 'float',
'type' => 'int',
'type' => BarcodeType::class,
];

public function label(): Relation
Expand Down
3 changes: 2 additions & 1 deletion src/PdfDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Rpungello\LaravelLabels;

use Illuminate\Contracts\Support\Arrayable;
use Rpungello\LaravelLabels\Enums\BarcodeType;
use Rpungello\LaravelLabels\Models\Label;
use Rpungello\LaravelLabels\Models\LabelBarcode;
use Rpungello\LaravelLabels\Models\LabelField;
Expand Down Expand Up @@ -128,7 +129,7 @@ private function addLabelBarcode(LabelBarcode $barcode, PrintsOnLabels $data, fl

$formattedContent = LaravelStringTemplate::format($barcode->content, $data->getLabelData());

if ($barcode->type === LabelBarcode::TYPE_1D) {
if ($barcode->type === BarcodeType::OneDimensional) {
$this->write1DBarcode(
$formattedContent,
$barcode->symbology,
Expand Down

0 comments on commit aed9f1e

Please sign in to comment.