Files
ladill-pos/app/Console/Commands/MarkDevicesOfflineCommand.php
isaacclad c01518b0ee
Deploy Ladill POS / deploy (push) Successful in 42s
Add Frontdesk-style Devices registry for POS hardware.
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.
2026-07-15 21:49:21 +00:00

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;
}
}