forceRefresh = true; if (($connection = EtsyConnection::first()) && $etsy->configured()) { $this->refresh('etsy receipts', fn () => $etsy->receipts($connection)); $this->refresh('etsy listings', fn () => $etsy->listings($connection)); } $this->refresh('parcel2go', function () use ($parcel2Go): void { $parcel2Go->verifyCredentials(); foreach (['me/orders/detail', 'me/detail', 'me/prepay/balance'] as $path) { $this->refresh('parcel2go '.$path, fn () => $parcel2Go->fetch($path)); } }); if ($bambuddy->configured()) { $this->refresh('bambuddy printers', fn () => $bambuddy->printers()); $this->refresh('bambuddy queue', fn () => $bambuddy->queue()); $this->refresh('bambuddy recent prints', fn () => $bambuddy->recentPrints()); $this->refresh('bambuddy stats', fn () => $bambuddy->stats()); $this->refresh('bambuddy spools', fn () => $bambuddy->spools()); } if ($dryer->configured()) { $this->refresh('dryer status', fn () => $dryer->status()); $this->refresh('dryer history', fn () => $dryer->history()); } return self::SUCCESS; } private function refresh(string $label, Closure $fetch): void { try { $fetch(); $this->line($label.': refreshed'); } catch (Throwable $exception) { $this->warn($label.': '.$exception->getMessage()); } } }