I have a pages collection, I pluck the uri from each page into array, then yaml encode it, to programatically update a pages field, something like this:
// consider I have a valid collection in $selectedWorksPages, and a valid page in $p
$selectedWorks = $selectedWorksPages->pluck('uri');
$p->update([
'selectedworks' => Data::encode($selectedWorks, 'yaml')
]);
In the .txt file, this results in a list with a mixed format, such as:
Selectedworks:
- artworks/cratere-6237
- artworks/keats-between-cubes-6239
- >
artworks/division-of-the-square-nietzsche-6240
- >
artworks/division-of-the-square-a-couple-6241
- >
artworks/cube-the-picture-of-dorian-gray-6242
- artworks/8-arms-with-times-6243
- >
artworks/angolo-stanco-hommage-a-la-mort-de-walter-benjamin-6244
- artworks/marble-between-1-year-6245
- >
artworks/old-chair-with-old-shoes-old-capital-but-new-newspaper-6246
- artworks/medio-pollice-rosa-6247
Why ? is this ok ?
Thanks