Lint
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
2f2c5c660b
commit
abc792d5b7
|
|
@ -31,7 +31,11 @@ class CreateExcelDocumentAction
|
||||||
private function allSheet(Collection $participants): TableDocumentData
|
private function allSheet(Collection $participants): TableDocumentData
|
||||||
{
|
{
|
||||||
$document = TableDocumentData::from(['title' => 'Anmeldungen für ' . $this->form->name, 'sheets' => []]);
|
$document = TableDocumentData::from(['title' => 'Anmeldungen für ' . $this->form->name, 'sheets' => []]);
|
||||||
$headers = $this->form->getFields()->map(fn ($field) => $field->name)->push('Abgemeldet am')->prepend('ID')->toArray();
|
$headers = [
|
||||||
|
'ID',
|
||||||
|
...$this->form->getFields()->names(),
|
||||||
|
'Abgemeldet am',
|
||||||
|
];
|
||||||
[$activeParticipants, $cancelledParticipants] = $participants->partition(fn ($participant) => $participant->cancelled_at === null);
|
[$activeParticipants, $cancelledParticipants] = $participants->partition(fn ($participant) => $participant->cancelled_at === null);
|
||||||
|
|
||||||
$document->addSheet(SheetData::from([
|
$document->addSheet(SheetData::from([
|
||||||
|
|
@ -68,10 +72,11 @@ class CreateExcelDocumentAction
|
||||||
|
|
||||||
/** @return array<string, mixed> */
|
/** @return array<string, mixed> */
|
||||||
public function rowFor(Participant $participant): array {
|
public function rowFor(Participant $participant): array {
|
||||||
return $this->form->getFields()->map(fn ($field) => $participant->getFields()->find($field)->presentRaw())
|
return [
|
||||||
->put('Abgemeldet am', $participant->cancelled_at?->format('d.m.Y H:i:s') ?: '')
|
'ID' => $participant->id,
|
||||||
->prepend('ID', $participant->id)
|
...$this->form->getFields()->map(fn ($field) => $participant->getFields()->find($field)->presentRaw()),
|
||||||
->toArray();
|
'Abgemeldet am' => $participant->cancelled_at?->format('d.m.Y H:i:s') ?: '',
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
private function tempPath(): string
|
private function tempPath(): string
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue