get(); /** @var Account $account */ foreach ($accounts as $account) { $iban = $account->iban; if (str_contains($iban, ' ')) { $iban = app('steam')->filterSpaces((string)$account->iban); if ('' !== $iban) { $account->iban = $iban; $account->save(); $this->line(sprintf('Removed spaces from IBAN of account #%d', $account->id)); } } } return 0; } }