Remove config from git

Update packages
Add list command
This commit is contained in:
René Preuß
2024-06-21 22:19:21 +02:00
parent b4e617ee74
commit acedefd370
8 changed files with 654 additions and 70 deletions

View File

@@ -1,48 +0,0 @@
<?php
namespace App\Commands;
use Illuminate\Console\Scheduling\Schedule;
use LaravelZero\Framework\Commands\Command;
use function Termwind\{render};
class InspireCommand extends Command
{
/**
* The signature of the command.
*
* @var string
*/
protected $signature = 'inspire {name=Artisan}';
/**
* The description of the command.
*
* @var string
*/
protected $description = 'Display an inspiring quote';
/**
* Execute the console command.
*/
public function handle(): void
{
render(<<<'HTML'
<div class="py-1 ml-2">
<div class="px-1 bg-blue-300 text-black">Laravel Zero</div>
<em class="ml-1">
Simplicity is the ultimate sophistication.
</em>
</div>
HTML);
}
/**
* Define the command's schedule.
*/
public function schedule(Schedule $schedule): void
{
// $schedule->command(static::class)->everyMinute();
}
}

View File

@@ -0,0 +1,50 @@
<?php
namespace App\Commands;
use LaravelZero\Framework\Commands\Command;
use Smalot\Cups\Builder\Builder;
use Smalot\Cups\Manager\PrinterManager;
use Smalot\Cups\Transport\Client;
use Smalot\Cups\Transport\ResponseParser;
class ListCommand 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.
*
* @return int
*/
public function handle(): int
{
$client = new Client();
$builder = new Builder();
$responseParser = new ResponseParser();
$printerManager = new PrinterManager($builder, $client, $responseParser);
$printers = $printerManager->getList();
$this->info('Printers:');
foreach ($printers as $printer) {
$this->info($printer->getName());
}
return 0;
}
}

View File

@@ -28,7 +28,7 @@ class ServeCommand extends Command
* Execute the console command.
* @throws RequestException
*/
public function handle()
public function handle(): void
{
$this->info('Starting service...');