Compare commits
No commits in common. "abc792d5b7c213e9b5ebfaba91ac90d5a8fbb4e8" and "b5779c3ecf0da563b5a10fc96ecde344ae2786af" have entirely different histories.
abc792d5b7
...
b5779c3ecf
|
|
@ -31,11 +31,7 @@ class CreateExcelDocumentAction
|
|||
private function allSheet(Collection $participants): TableDocumentData
|
||||
{
|
||||
$document = TableDocumentData::from(['title' => 'Anmeldungen für ' . $this->form->name, 'sheets' => []]);
|
||||
$headers = [
|
||||
'ID',
|
||||
...$this->form->getFields()->names(),
|
||||
'Abgemeldet am',
|
||||
];
|
||||
$headers = $this->form->getFields()->map(fn ($field) => $field->name)->push('Abgemeldet am')->prepend('ID')->toArray();
|
||||
[$activeParticipants, $cancelledParticipants] = $participants->partition(fn ($participant) => $participant->cancelled_at === null);
|
||||
|
||||
$document->addSheet(SheetData::from([
|
||||
|
|
@ -72,11 +68,10 @@ class CreateExcelDocumentAction
|
|||
|
||||
/** @return array<string, mixed> */
|
||||
public function rowFor(Participant $participant): array {
|
||||
return [
|
||||
'ID' => $participant->id,
|
||||
...$this->form->getFields()->map(fn ($field) => $participant->getFields()->find($field)->presentRaw()),
|
||||
'Abgemeldet am' => $participant->cancelled_at?->format('d.m.Y H:i:s') ?: '',
|
||||
];
|
||||
return $this->form->getFields()->map(fn ($field) => $participant->getFields()->find($field)->presentRaw())
|
||||
->put('Abgemeldet am', $participant->cancelled_at?->format('d.m.Y H:i:s') ?: '')
|
||||
->prepend('ID', $participant->id)
|
||||
->toArray();
|
||||
}
|
||||
|
||||
private function tempPath(): string
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace Illuminate\Testing;
|
||||
|
||||
namespace Spatie\LaravelSettings;
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue