Download the PHP package beziworld/laravel-label-printing without Composer

On this page you can find all versions of the php package beziworld/laravel-label-printing. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-label-printing

Laravel Label Printing

tests Latest Version

Server side printing of shipping labels and non-fiscal receipts from Laravel:

Polska wersja dokumentacji

Why this package

Packagist (November 2026) has mike42/escpos-php (2.6M downloads) and robgridley/zebra (2.2M) as framework agnostic libraries, but the Laravel side is thin: charlieuki/receiptprinter wraps escpos-php 2.x and is no longer maintained, abdullah-life/laravel-zebra-image-printer only converts PNG to ZPL, and the QZ Tray / Web Serial packages print from the browser, not from the server. None of them gives you named printers, courier ZPL passthrough, queued jobs with safe retries and test fakes in one place.

This package depends on mike42/escpos-php ^5.0 (MIT, maintained, PHP 8.2+) for ESC/POS command rendering. The ZPL builder is written here, because robgridley/zebra has not been released since 2022 and calls imagedestroy(), which is deprecated in PHP 8.5.

Installation

Requires PHP 8.3+, Laravel 12 or 13, ext-intl (required by escpos-php) and ext-gd for images.

Configuration

Driver How bytes are delivered
network TCP socket to host:port (JetDirect / AppSocket, usually 9100)
cups lp [-h host] -d destination -o raw [-o ...] - with the job on standard input
windows On Windows: written to the UNC path. Elsewhere: smbclient //HOST/Printer -c 'print -', password in the PASSWD environment variable. method forces copy or smbclient
file file_put_contents() to a file or a device such as /dev/usb/lp0; append keeps a capture log
null Discards the job

language (zpl, epl, escpos, raw) protects you from sending a receipt to a label printer or the other way round; raw printers accept anything. Printers are validated when first used, so one incomplete definition does not break the others.

Print courier labels (ZPL / EPL passthrough)

zpl() checks that the data contains ^XA, epl() that it contains a P print command. Ask the courier API for ZPL or EPL: thermal printers in these modes cannot print PDF labels.

Build a ZPL label

Text is sent as UTF-8 under ^CI28; ^, ~, _ and \ are escaped with ^FH. Whether Polish letters print depends on the font in the printer (font 0 on current Zebra firmware is the usual choice). Images are thresholded to black and white and sent as an uncompressed ^GFA graphic; transparent pixels are white.

Print an ESC/POS receipt

The receipt starts with ESC @ and ESC t n and all text is encoded into that one code page:

code_page Default ESC t Polish
cp852 (default) 18 yes
cp1250 45 yes
iso8859-2 39 yes
cp858 19 no (Western European, euro sign)
cp437 0 no

Table numbers follow the Epson numbering. Many clones use different numbers: print the test page and set code_page_table if the letters come out wrong. Characters missing from the code page are transliterated (€ becomes EUR in PC852) or replaced with ?. profile is an escpos-php capability profile (default, TM-T88V, simple, ...); features the profile lacks (for example QR on simple) raise InvalidPayload.

These are non-fiscal printouts: fiscal printers and cash register protocols are out of scope.

Queue print jobs

Payloads are rendered before dispatch and stored base64 encoded, so the worker prints exactly the bytes you built. PrintJob retries only ConnectionFailed (the printer could not be reached, nothing was sent), with the configured tries and backoff. Any other error, including a connection that dropped in the middle of a job, fails the job immediately, because a retry could print the label twice. Runtime printers created with using() travel inside the job payload, including their credentials.

Runtime printers and events

Event Payload
PrintSucceeded $result (PrintResult: printer, endpoint, language, bytes, copies, durationMs, reference)
PrintFailed printer, language, bytes, exception, retryable, reference

Raw printer protocols have no acknowledgement: success means the transport accepted every byte, not that the label left the printer.

Test page

Testing your code

Errors

All exceptions extend Beziworld\LabelPrinting\Exceptions\LabelPrintingException; isRetryable() tells whether a retry is safe.

Exception When Retried by PrintJob
InvalidConfiguration missing or invalid printer settings, unknown printer, unknown profile no
InvalidPayload malformed ZPL / EPL / base64, invalid barcode data, wrong language for the printer no
ConnectionFailed socket connect failed, CUPS scheduler or SMB host unreachable yes
TransportFailed write broke off, lp / smbclient rejected the job, file not writable no

Development

Tests never touch real printers: transports are faked, lp and smbclient run through Process::fake(), and the TCP transport is exercised against a local listener on 127.0.0.1. Builder tests assert exact bytes.

Author

Created and maintained by Kamil Ćwiertnia, beziworld.eu.

Need an integration? Get in touch through beziworld.eu.

Other packages by the author

laravel-inpost · laravel-dpd · laravel-dhl-parcel · laravel-gls · laravel-ups

License

MIT. See LICENSE.md. This package is not affiliated with Zebra Technologies, Seiko Epson, the CUPS or Samba projects, or any courier.


All versions of laravel-label-printing with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
ext-intl Version *
ext-json Version *
illuminate/bus Version ^12.0|^13.0
illuminate/console Version ^12.0|^13.0
illuminate/contracts Version ^12.0|^13.0
illuminate/events Version ^12.0|^13.0
illuminate/process Version ^12.0|^13.0
illuminate/queue Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0
mike42/escpos-php Version ^5.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package beziworld/laravel-label-printing contains the following files

Loading the files please wait ...