diff --git a/src/Support/Embeds/GenericEmbed.php b/src/Support/Embeds/GenericEmbed.php index e5643c5..fb3be4d 100644 --- a/src/Support/Embeds/GenericEmbed.php +++ b/src/Support/Embeds/GenericEmbed.php @@ -93,7 +93,7 @@ public function toArray(): array 'provider' => $this->provider?->toArray(), 'author' => $this->author?->toArray(), 'fields' => array_map(function (FieldEmbed $field): array { - return $field->toArray(); + return $field->toArray()['field']; }, $this->fields), ]); } diff --git a/tests/Unit/Support/Embeds/GenericEmbedTest.php b/tests/Unit/Support/Embeds/GenericEmbedTest.php index b8e4ff7..81324a6 100644 --- a/tests/Unit/Support/Embeds/GenericEmbedTest.php +++ b/tests/Unit/Support/Embeds/GenericEmbedTest.php @@ -84,8 +84,8 @@ public function testEmbedWithAllOptions() 'thumbnail' => $thumbnail->toArray(), 'video' => $video->toArray(), 'fields' => [ - $field1->toArray(), - $field2->toArray(), + $field1->toArray()['field'], + $field2->toArray()['field'], ], ], $embed->toArray()); }