Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximilianRadons committed Feb 21, 2022
1 parent f1470dc commit 3ec998e
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,37 @@ $homepageArray = $strapi->populate(['*'])->single('homepage');
$homepageArray = $strapi->populate(['homepage.navbar.links', 'homepage.metadata'])->single('homepage');
```

Deeply populate a dynamic zone with 2 components:
Examples from [Strapi API Docs](https://docs.strapi.io/developer-docs/latest/developer-resources/database-apis-reference/rest/populating-fields.html#component-dynamic-zones)

```php
use MaximilianRadons\LaravelStrapi\LaravelStrapi;

$strapi = new LaravelStrapi();

$query = [
'populate' => [
'testDZ' => [
'populate' => '*'
],
]
];

$homepageArray = $strapi->query($query)->single('articels');

$query = [
'fields' => ['title', 'slug'],
'populate' => [
'headerImage' => [
'fields' => ['name', 'url']
],
]
];

$homepageArray = $strapi->query($query)->single('articels');

```

## Changelog

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
Expand Down

0 comments on commit 3ec998e

Please sign in to comment.