rawilk / laravel-printing
Direct printing for Laravel apps
Fund package maintenance!
rawilk
Installs: 143 937
Dependents: 0
Suggesters: 0
Security: 0
Stars: 467
Watchers: 10
Forks: 73
Open Issues: 7
Requires
- php: ^8.0|^8.1|^8.2|^8.3
- guzzlehttp/guzzle: ^7.5
- illuminate/support: ^8.0|^9.0|^10.0|^11.0
- mike42/escpos-php: ^4.0
- spatie/laravel-package-tools: ^1.2|^1.13
Requires (Dev)
- laravel/pint: ^1.5
- mockery/mockery: >=1.4
- orchestra/testbench: ^6.0|^7.0|^8.0|^9.0
- pestphp/pest: ^1.20|^2.34
- pestphp/pest-plugin-laravel: ^1.0|^2.2
- php-http/message-factory: ^1.1
- php-http/socket-client: ^2.1
- psr/http-client: ^1.0
- psr/http-message: 1.*
- smalot/cups-ipp: ^0.5.0
- spatie/laravel-ray: ^1.0|^1.29
Suggests
- smalot/cups-ipp: Required when using the CUPS driver
README
Printing for Laravel allows your application to directly send PDF documents or raw text directly from a remote server
to a printer on your local network. Receipts can also be printed by first generating the raw text via the Rawilk\Printing\Receipts\ReceiptPrinter
class, and then sending the text as a raw print job via the Printing
facade.
$printJob = Printing::newPrintTask() ->printer($printerId) ->file('path_to_file.pdf') ->send(); $printJob->id(); // the id number returned from the print server
Supported Print Drivers:
- PrintNode: https://printnode.com
- CUPS: https://cups.org
- Custom: Configure your own custom driver
Documentation:
For documentation, please visit: https://randallwilk.dev/docs/laravel-printing
Installation
You can install the package via composer:
composer require rawilk/laravel-printing
You can publish the config file with:
php artisan vendor:publish --tag="printing-config"
The contents of the default configuration file can be found here: https://github.com/rawilk/laravel-printing/blob/main/config/printing.php
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email randall@randallwilk.dev instead of using the issue tracker.
Credits
- Randall Wilk
- All Contributors
- Mike42 for the PHP ESC/POS Print Driver library
Inspiration for the PrintNode API wrapper comes from:
Disclaimer
This package is not affiliated with, maintained, authorized, endorsed or sponsored by Laravel or any of its affiliates.
License
The MIT License (MIT). Please see License File for more information.