diff --git a/app/Form/Resources/ParticipantResource.php b/app/Form/Resources/ParticipantResource.php index 68235b37..ec3f3991 100644 --- a/app/Form/Resources/ParticipantResource.php +++ b/app/Form/Resources/ParticipantResource.php @@ -23,6 +23,7 @@ class ParticipantResource extends JsonResource { return [ ...$this->getModel()->getFields()->present(), + 'id' => $this->id, 'created_at' => $this->created_at->format('Y-m-d H:i:s'), 'created_at_display' => $this->created_at->format('d.m.Y'), 'children_count' => $this->children_count, diff --git a/tests/Feature/Form/ParticipantIndexActionTest.php b/tests/Feature/Form/ParticipantIndexActionTest.php index fa73c522..07d1710c 100644 --- a/tests/Feature/Form/ParticipantIndexActionTest.php +++ b/tests/Feature/Form/ParticipantIndexActionTest.php @@ -35,6 +35,7 @@ class ParticipantIndexActionTest extends FormTestCase $this->callFilter('form.participant.index', [], ['form' => $form]) ->assertOk() + ->assertJsonPath('data.0.id', $form->participants->first()->id) ->assertJsonPath('data.0.vorname', 'Max') ->assertJsonPath('data.0.vorname_display', 'Max') ->assertJsonPath('data.0.stufe', 'Pfadfinder')