where('via', BillKind::POST)->get() as $invoice) { $document = BillDocument::fromInvoice($invoice); $documents[] = $document; $invoice->sent($document); } foreach (Invoice::whereNeedsRemember()->where('via', BillKind::POST)->get() as $invoice) { $document = RememberDocument::fromInvoice($invoice); $documents[] = $document; $invoice->sent($document); } if (!count($documents)) { return response()->noContent(); } return Tex::merge($documents); } }