omaghd/shipping-label
Larablocks Analysis
omaghd/shipping-label works with Laravel 10, 11 and 12 (latest release v1.0.3, Nov 30, 2026).
Recommendation checks
Use with careUse with care: meets 1 of 4 checks.
- Latest release doesn't support Laravel 13, the current version
- Released in the last 12 months (Nov 30, 2026)
- 82 downloads a month (needs 10,000)
- 2 GitHub stars (needs 100)
State
Actively maintained- Last stable release: Nov 30, 2026.
- 4 releases in the last 12 months.
- First released: Jan 7, 2026.
- Monthly downloads: 82.
- 0 open issues on GitHub.
Data from Packagist and GitHub, checked by Larablocks on Dec 1, 2026.
| Install | |
|---|---|
composer require omaghd/shipping-label |
|
| Latest Version: | v1.0.3 |
| PHP: | ^8.2 |
| Laravel: | 10 · 11 · 12 |
| License: | MIT |
| Last Updated: | Nov 30, 2026 |
| Links: | GitHub · Packagist |
A Laravel package for generating shipping labels
Generate fast, precise PDF shipping labels with a flexbox-inspired layout engine. The package keeps the domain (elements and styling) separate from layout math and rendering, uses readonly value objects, and ships with a TCPDF driver pre-configured for internal fonts.
Demo
Try the interactive demo at labels.omaghd.com.
| English | Arabic |
|---|---|
![]() |
![]() |
Installation
You can install the package via composer:
composer require omaghd/shipping-label
Usage
use OmaghD\ShippingLabel\Label;
use OmaghD\ShippingLabel\Nodes\Column;
use OmaghD\ShippingLabel\Nodes\Row;
use OmaghD\ShippingLabel\Enums\BarcodeType;
use OmaghD\ShippingLabel\Enums\Unit;
use OmaghD\ShippingLabel\ValueObjects\Color;
use OmaghD\ShippingLabel\ValueObjects\Gutter;
use OmaghD\ShippingLabel\ValueObjects\Margin;
use OmaghD\ShippingLabel\ValueObjects\Padding;
use OmaghD\ShippingLabel\Config\LabelConfig;
use OmaghD\ShippingLabel\Config\RowConfig;
use OmaghD\ShippingLabel\Config\ColumnConfig;
use OmaghD\ShippingLabel\Config\TextStyleConfig;
use OmaghD\ShippingLabel\Elements\TextElement;
use OmaghD\ShippingLabel\Elements\ImageElement;
use OmaghD\ShippingLabel\Elements\SpacerElement;
use OmaghD\ShippingLabel\Elements\BulletsElement;
use OmaghD\ShippingLabel\Elements\RadioElement;
use OmaghD\ShippingLabel\Elements\BarcodeElement;
use OmaghD\ShippingLabel\Elements\QrCodeElement;
use OmaghD\ShippingLabel\Config\Elements\TextElementConfig;
use OmaghD\ShippingLabel\Config\Elements\ImageElementConfig;
use OmaghD\ShippingLabel\Config\Elements\SpacerElementConfig;
use OmaghD\ShippingLabel\Config\Elements\BulletsElementConfig;
use OmaghD\ShippingLabel\Config\Elements\RadioElementConfig;
use OmaghD\ShippingLabel\Config\Elements\BarcodeElementConfig;
use OmaghD\ShippingLabel\Config\Elements\QrCodeElementConfig;
Route::get('labels', function () {
$label = Label::make()
->config(
config: LabelConfig::make()
->square()
->unit(Unit::Mm)
->borderStroke(width: 0.1)
->borderColor(hexCode: Color::BLACK)
->margin(margin: Margin::uniform(5))
->gutter(gutter: Gutter::symmetric(2))
->defaultTextStyle(
config: TextStyleConfig::make()
->fontSize(value: 8.0)
->color(hexCode: Color::fromHex('#000000'))
)
);
$orders = [
['id' => '101123456789', 'name' => 'Omar EL ATMANI', 'city' => 'Rabat', 'phone' => '06 23 28 02 12'],
['id' => '102123456789', 'name' => 'Sara ALAMI', 'city' => 'Casablanca', 'phone' => '06 11 22 33 44'],
['id' => '103123456789', 'name' => 'Ahmed BENNANI', 'city' => 'Fes', 'phone' => '06 55 66 77 88'],
['id' => '104123456789', 'name' => 'Karim TAZI', 'city' => 'Tangier', 'phone' => '06 99 88 77 66'],
['id' => '105123456789', 'name' => 'Ikram SADIKI', 'city' => 'Marrakech', 'phone' => '06 12 34 56 78'],
];
foreach ($orders as $index => $order) {
if ($index > 0) {
$label->nextLabel();
}
$label
->addRow(
row: Row::make()
->config(
config: RowConfig::make()
->height(ratio: 2.0)
)
->addColumn(
column: Column::make()
->config(
config: ColumnConfig::make()
->span(weight: 1)
->padding(padding: Padding::uniform(0))
->verticalAlignMiddle()
->horizontalAlignCenter()
)
->addElement(
element: ImageElement::make()
->path(path: public_path('assets/images/logo.svg'))
->config(
config: ImageElementConfig::make()
->height(value: 2.0)
->width(value: 20.0)
->horizontalAlignCenter()
)
)
->addElement(
element: TextElement::make()
->content(text: $order['city'])
->config(
config: TextElementConfig::make()
->bold()
->fontSize(value: 8.0)
->horizontalAlignCenter()
)
)
->addElement(
element: TextElement::make()
->content(text: 'Hub ' . $order['city'])
->config(
config: TextElementConfig::make()
->fontSize(value: 6.0)
->horizontalAlignCenter()
)
)
)
->addColumn(
column: Column::make()
->config(
config: ColumnConfig::make()
->span(weight: 1)
->verticalAlignMiddle()
->horizontalAlignCenter()
)
->addElement(
element: TextElement::make()
->content(text: 'Amount')
->config(
config: TextElementConfig::make()
->horizontalAlignCenter()
)
)
->addElement(
element: SpacerElement::make()
->config(
config: SpacerElementConfig::make()
->height(value: 2.0)
)
)
->addElement(
element: TextElement::make()
->content(text: '$399')
->config(
config: TextElementConfig::make()
->bold()
->fontSize(value: 10.0)
->horizontalAlignCenter()
)
)
)
)
->addRow(
row: Row::make()
->config(
config: RowConfig::make()
->height(ratio: 1.5)
)
->addColumn(
column: Column::make()
->config(
config: ColumnConfig::make()
->span(weight: 1)
->verticalAlignMiddle()
->horizontalAlignCenter()
)
->addElement(
element: TextElement::make()
->content(text: 'Client: **' . $order['name'] . '**')
->config(
config: TextElementConfig::make()
->horizontalAlignCenter()
)
)
)
->addColumn(
column: Column::make()
->config(
config: ColumnConfig::make()
->span(weight: 1)
->verticalAlignMiddle()
->horizontalAlignCenter()
)
->addElement(
element: TextElement::make()
->content(text: 'Client Phone: **' . $order['phone'] . '**')
->config(
config: TextElementConfig::make()
->horizontalAlignCenter()
)
)
)
)
->addRow(
row: Row::make()
->config(
config: RowConfig::make()
->height(ratio: 1.5)
)
->addColumn(
column: Column::make()
->config(
config: ColumnConfig::make()
->span(weight: 1)
->padding(padding: Padding::uniform(0))
->verticalAlignMiddle()
->horizontalAlignCenter()
)
->addElement(
element: TextElement::make()
->content(text: 'Address: **Street 1, ' . $order['city'] . '**')
->config(
config: TextElementConfig::make()
->fontSize(value: 6.0)
->horizontalAlignCenter()
)
)
)
)
->addRow(
row: Row::make()
->config(
config: RowConfig::make()
->height(ratio: 3.0)
)
->addColumn(
column: Column::make()
->config(
config: ColumnConfig::make()
->padding(padding: Padding::uniform(0))
->verticalAlignTop()
->horizontalAlignStart()
)
->addElement(
element: BulletsElement::make()
->addItem(text: '1x : iPhone 17 Pro Max')
->addItem(text: '4x : Sony WH-1000XM4')
->addItem(text: '1x : Samsung Galaxy S21')
->config(
config: BulletsElementConfig::make()
->fontSize(value: 6.0)
->lineHeight(value: 3.5)
->horizontalAlignStart()
)
)
)
)
->addRow(
row: Row::make()
->config(
config: RowConfig::make()
->height(ratio: 1.0)
)
->addColumn(
column: Column::make()
->config(
config: ColumnConfig::make()
->span(weight: 1)
->verticalAlignMiddle()
->horizontalAlignCenter()
)
->addElement(
element: TextElement::make()
->content(text: 'Store: Floral Shop')
->config(
config: TextElementConfig::make()
->fontSize(value: 6.0)
->horizontalAlignCenter()
)
)
)
->addColumn(
column: Column::make()
->config(
config: ColumnConfig::make()
->span(weight: 1)
->verticalAlignMiddle()
->horizontalAlignCenter()
)
->addElement(
element: TextElement::make()
->content(text: 'Store Phone: 522 456 1234')
->config(
config: TextElementConfig::make()
->fontSize(value: 6.0)
->horizontalAlignCenter()
)
)
)
)
->addRow(
row: Row::make()
->config(
config: RowConfig::make()
->height(ratio: 1.0)
)
->addColumn(
column: Column::make()
->config(
config: ColumnConfig::make()
->span(weight: 1)
->padding(padding: Padding::uniform(0))
->verticalAlignMiddle()
->horizontalAlignCenter()
)
->addElement(
element: TextElement::make()
->content(text: 'Store Address: Street 123')
->config(
config: TextElementConfig::make()
->fontSize(value: 6.0)
->horizontalAlignCenter()
)
)
)
)
->addRow(
row: Row::make()
->config(
config: RowConfig::make()
->height(ratio: 1.5)
)
->addColumn(
column: Column::make()
->config(
config: ColumnConfig::make()
->span(weight: 1)
->verticalAlignMiddle()
->horizontalAlignCenter()
)
->addElement(
element: TextElement::make()
->content(text: 'For customer service purposes, call us on: 522 456 7899')
->config(
config: TextElementConfig::make()
->fontSize(value: 6.0)
->horizontalAlignCenter()
)
)
)
)
->addRow(
row: Row::make()
->config(
config: RowConfig::make()
->height(ratio: 1.5)
)
->addColumn(
column: Column::make()
->config(
config: ColumnConfig::make()
->span(weight: 1)
->padding(padding: Padding::uniform(0))
->verticalAlignMiddle()
->horizontalAlignCenter()
)
->addElement(
element: RadioElement::make()
->label(text: 'Open:')
->selectedLabel(text: 'Yes')
->unselectedLabel(text: 'No')
->selected(state: true)
->config(
config: RadioElementConfig::make()
->verticalAlignMiddle()
->horizontalAlignStart()
)
)
)
->addColumn(
column: Column::make()
->config(
config: ColumnConfig::make()
->span(weight: 1)
->padding(padding: Padding::uniform(0))
->verticalAlignMiddle()
->horizontalAlignCenter()
)
->addElement(
element: RadioElement::make()
->label(text: 'Try:')
->selectedLabel(text: 'Yes')
->unselectedLabel(text: 'No')
->selected(state: false)
->config(
config: RadioElementConfig::make()
->verticalAlignMiddle()
->horizontalAlignStart()
)
)
)
->addColumn(
column: Column::make()
->config(
config: ColumnConfig::make()
->span(weight: 1)
->padding(padding: Padding::uniform(0))
->verticalAlignMiddle()
->horizontalAlignCenter()
)
->addElement(
element: RadioElement::make()
->label(text: 'Exchange:')
->selectedLabel(text: 'Yes')
->unselectedLabel(text: 'No')
->selected(state: false)
->config(
config: RadioElementConfig::make()
->verticalAlignMiddle()
->horizontalAlignStart()
)
)
)
)
->addRow(
row: Row::make()
->config(
config: RowConfig::make()
->height(ratio: 1.5)
)
->addColumn(
column: Column::make()
->config(
config: ColumnConfig::make()
->span(weight: 1)
->padding(padding: Padding::uniform(0))
->verticalAlignMiddle()
->horizontalAlignCenter()
)
->addElement(
element: TextElement::make()
->content(text: 'Thank you for choosing us.')
->config(
config: TextElementConfig::make()
->fontSize(value: 6.0)
->lineHeight(value: 1.2)
->maxLines(2)
->horizontalAlignCenter()
)
)
)
)
->addRow(
row: Row::make()
->config(
config: RowConfig::make()
->height(ratio: 3.0)
)
->addColumn(
column: Column::make()
->config(
config: ColumnConfig::make()
->span(weight: 3)
->padding(padding: Padding::uniform(0))
->verticalAlignMiddle()
->horizontalAlignCenter()
)
->addElement(
element: BarcodeElement::make()
->code(text: 'OM' . $order['id'])
->type(type: BarcodeType::C128)
->config(
config: BarcodeElementConfig::make()
->height(value: 13.0)
)
)
)
->addColumn(
column: Column::make()
->config(
config: ColumnConfig::make()
->span(weight: 1)
->padding(padding: Padding::uniform(0))
->verticalAlignMiddle()
->horizontalAlignCenter()
)
->addElement(
element: ImageElement::make()
->path(path: public_path('assets/images/image.png'))
->config(
config: ImageElementConfig::make()
->height(value: 13.0)
->width(value: 13.0)
->fitCover()
)
)
)
->addColumn(
column: Column::make()
->config(
config: ColumnConfig::make()
->span(weight: 1)
->padding(padding: Padding::uniform(0))
->verticalAlignMiddle()
->horizontalAlignCenter()
)
->addElement(
element: QrCodeElement::make()
->content(text: 'https://omaghd.com/track/' . $order['id'])
->config(
config: QrCodeElementConfig::make()
->fontSize(value: 13.0)
)
)
)
)
->addRow(
row: Row::make()
->config(
config: RowConfig::make()
->height(ratio: 1.0)
)
->addColumn(
column: Column::make()
->config(
config: ColumnConfig::make()
->span(weight: 1)
->verticalAlignMiddle()
->horizontalAlignCenter()
)
->addElement(
element: TextElement::make()
->content(text: 'Our shipping company is responsible for delivery only.')
->config(
config: TextElementConfig::make()
->fontSize(value: 6.0)
->horizontalAlignCenter()
)
)
)
);
}
$label->render(filename: 'labels.pdf');
});
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
Related Packages
Powerful PHP database abstraction layer (DBAL) with many features for database s...
Laravel Serializable Closure provides an easy and secure way to serialize closur...
Cli error handling for console/command-line PHP applications.
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| v1.0.3 | ^8.2 | ^10.0|| | MIT | |
| v1.0.2 | ^8.2 | ^10.0|| | MIT | |
| v1.0.1 | ^8.2 | ^10.0|| | MIT | |
| v1.0.0 | ^8.2 | ^10.0|| | MIT |

