invoice->exported_at !== null) { return; } $archive->store($this->invoice); $this->invoice->forceFill([ 'exported_at' => now(), 'export_error' => null, ])->save(); } public function failed(?Throwable $e): void { // On the invoice, not only in the log. The console shows it there, and // a log line nobody reads is not a report. $this->invoice->forceFill([ 'export_error' => mb_substr((string) $e?->getMessage(), 0, 250), ])->save(); } }