Add autowire

Add logs command
Improve print jobs handling
Improve installation/documentation
This commit is contained in:
René Preuß
2025-07-29 22:16:32 +02:00
parent a152074975
commit 621b6cb5c0
17 changed files with 645 additions and 484 deletions

44
app/Commands/Printers.php Normal file
View File

@@ -0,0 +1,44 @@
<?php
namespace App\Commands;
use App\Support\PrinterManager;
use LaravelZero\Framework\Commands\Command;
class Printers extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'printers';
/**
* The console command description.
*
* @var string
*/
protected $description = 'List all printers';
/**
* Execute the console command.
*/
public function handle(PrinterManager $printers): int
{
$printers = $printers->getList();
if ($printers->isEmpty()) {
$this->error('We could not find any printers! Please register them first in CUPS.');
return 1;
}
$this->info('Printer:');
foreach ($printers as $printer) {
$this->info($printer->getName());
}
return 0;
}
}