Basic Usage
Printer
{note} You're browsing the documentation for an old version of laravel-printing. Consider upgrading your project to v3. Check your version with the following command:
composer show rawilk/laravel-printing
Introduction
Each printer object should be an implementation of Rawilk\Printing\Contracts\Printer
. The printer has several properties on it that can
be accessed via these methods:
Printer Id
Your print server will create a unique id for each printer you have on it. You can retrieve the id like this:
$printer->id()
Printer Name
Each printer should also have a name, which can be retrieved like this:
$printer->name()
Capabilities
Your print server should be able to return a listing of the printer's capabilities. You can retrieve an array of them via:
$printer->capabilities()
Trays
If your printer and print driver support it, you can get a listing of your printer's available trays for use later:
$printer->trays()
Printer status
Your print server should return a text representation of your printer's current status:
$printer->status()
You can also check if the printer is online via:
$printer->isOnline()
Description
If your printer has a description set on it, it can be retrieved via:
$printer->description()
Serialization
The printer object can also be cast to array or json, and it will return the following info:
- id
- name
- description
- online
- status
- trays