-
Notifications
You must be signed in to change notification settings - Fork 65
Open
Description
I'm using contentful/laravel version 8.2.0 with PHP 7.4. And getting entries like this:
$query = new Query();
$query->setContentType('page')
->where('fields.slug', "test")
->setInclude(10);
$entries = $client->getEntries($query);
The $entries do contain all the data when I var_dump them. But when I serialize them with json_encode the resulting object doesn't provide included entries and fields like content or fields (see below - content is []). There are no images and files. I have custom fields, they're not serialized either:
{
"sys": { "type": "Array" },
"total": 1,
"limit": 100,
"skip": 0,
"items": [
{
...
"fields": {
"title": "Test Test Test",
"slug": "test",
"description": "Full CMS Content Rendering Test",
"body": {
"nodeType": "document",
"content": [
{
"nodeType": "embedded-entry-block",
"data": {
"target": {
"sys": {
"type": "Link",
"id": "XXXXXXXXXXXXXXXXXX",
"linkType": "Entry"
}
}
},
"content": [] // <------ here
},
...
Is that right? Should I serialize everything myself?
For example when using Contentful Javascript SDK, there's the whole JSON object with all levels of hierarchy in the output.
Metadata
Metadata
Assignees
Labels
No labels