<?php

$moodboard = [];

foreach ($page->moodboard()->toFiles() as $image) {
  $moodboard[] = getFileData($image);
}

$specificData = [
  "tags" => $page->parent()->parent()->clientBriefImageTags()->split(),
  "moodboard" => $moodboard
];

$pageData = array_merge($genericData, $specificData);

echo json_encode([
  "page" => $pageData,
  "user" => $userData
]);