artisan-toolbox / qztray
QZ Tray Connector bridges Laravel and your frontend through a unified abstraction for QZ Tray integration.
Package info
github.com/artisan-toolbox/qztray
Language:TypeScript
pkg:composer/artisan-toolbox/qztray
Fund package maintenance!
Requires
- php: ^8.5
- ext-openssl: *
- artisan-toolbox/core: ^1.0
- artisan-toolbox/maintainer: ^1.10.0
- illuminate/support: ^13.0
Requires (Dev)
- driftingly/rector-laravel: ^2.5
- larastan/larastan: ^3.9
- laravel/pao: ^1.0
- laravel/pint: ^1.29
- orchestra/testbench: ^11.0
- pestphp/pest: ^5.0
- pestphp/pest-plugin-laravel: ^5.0
- pestphp/pest-plugin-type-coverage: ^5.0
- phpstan/extension-installer: ^1.4
- phpstan/phpstan: ^2.2.8
- rector/rector: ^2.6.2
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
QZ Tray Connector
Connect Laravel applications to local printers and preview ZPL labels, ESC/POS receipts, and PDFs.
Installation
Install the connector and Ziggy through Composer. Then install the frontend package from the Composer vendor directory.
composer require artisan-toolbox/qztray tightenco/ziggy:^2.0 npm install ./vendor/artisan-toolbox/qztray
The Composer distribution includes the compiled frontend and renderer assets; no npm registry publication or library build in the application is required.
Requires PHP 8.5 with OpenSSL and Laravel 13. TypeScript applications use Vite with "moduleResolution": "bundler". QZ Tray must run on the user's computer for printing. See the 1.x compatibility and API limits.
Usage
Publish the credential configuration from your Laravel application's root:
php artisan vendor:publish --tag=qztray-config
Set public_key to your complete PEM certificate and private_key to its matching PEM private key in config/qztray.php. See the credential setup guide for the full example and configuration cache steps. Connection, printer discovery, ESC/POS, ZPL, generic raw, PDF printing, and local ZPL, ESC/POS, and PDF previews are available in the 1.x series.
The frontend package exports a shared QzTray instance:
import qztray from '@artisan-toolbox/qztray'; await qztray.connect(); console.log(qztray.isConnected());
The application must use Ziggy (tightenco/ziggy and ziggy-js) and expose the connector's named routes to the frontend. Start with the quickstart and API overview; detailed printing, preview, error, and development guides live in the canonical documentation.