app/Console/Commands/GamePingCommand.php
use Azuriom\Models\Server;use Azuriom\Models\Setting;use Illuminate\Console\Command; class GamePingCommand extends Command{ protected $signature = 'game:ping'; protected $description = 'Ping the game servers to update their stats.'; public function handle() { Setting::updateSettings('schedule.last', now()->toISOString()); $servers = Server::pingable()->get(); foreach ($servers as $server) { $data = $server->bridge()->getServerData(); $server->updateData($data, now()->minute % 15 === 0); } $this->info($servers->count().' server(s) were successfully pinged.'); }}