Deploy Ladill POS / deploy (push) Successful in 42s
Register tills, customer displays, kitchen screens, printers, scanners, and tablets per branch. Customer displays share the branch display token and mark online when the public screen polls; stale devices go offline on a schedule.
23 lines
642 B
PHP
23 lines
642 B
PHP
<?php
|
|
|
|
namespace App\Console\Commands;
|
|
|
|
use App\Services\Pos\DeviceService;
|
|
use Illuminate\Console\Command;
|
|
|
|
class MarkDevicesOfflineCommand extends Command
|
|
{
|
|
protected $signature = 'pos:devices-offline {--minutes=10 : Consider devices stale after this many minutes}';
|
|
|
|
protected $description = 'Mark POS devices offline when they stop heartbeating.';
|
|
|
|
public function handle(DeviceService $devices): int
|
|
{
|
|
$minutes = max(1, (int) $this->option('minutes'));
|
|
$count = $devices->markStaleDevicesOffline($minutes);
|
|
$this->info("Marked {$count} device(s) offline.");
|
|
|
|
return self::SUCCESS;
|
|
}
|
|
}
|