$model->uuid, 'slug' => $model->slug, 'link' => $model->link, 'type' => $model->parsedType, 'sub_type' => $model->sub_type, 'name' => $model->name, 'title' => $model->title, 'description' => $model->description, 'keywords' => $model->keywords, 'h1' => $model->h1, 'has_children' => $model->children()->exists(), 'created_at' => $model->created_at ? $model->created_at->toIso8601String() : null, 'updated_at' => $model->updated_at ? $model->updated_at->toIso8601String() : null ]; } public function includeChildren(Page $model): Collection { return $this->collection($model->children, new PageTransformer()); } public function includeParent(Page $model): ?Item { return $model->parent ? $this->item($model->parent, new PageTransformer()) : null; } public function includeParents(Page $model): Collection { return $this->collection($model->parents->reverse(), new PageTransformer()); } public function includePicture(Page $model): ?Item { return $model->picture ? $this->item($model->picture, new AssetTransformer()) : null; } public function includeSections(Page $model): Collection { return $this->collection($model->sections, new ObjectTransformer()); } public function includeSidebars(Page $model): Collection { return $this->collection($model->sidebars, new ObjectTransformer()); } public function includePublications(Page $model): Collection { return $this->collection($model->publications, new PublicationTransformer()); } public function includeRegistries(Page $model): Collection { return $this->collection($model->registries, new RegistryTransformer()); } public function includeRegistry(Page $model): ?Item { return $model->registry ? $this->item($model->registry, new RegistryTransformer()) : null; } public function includePermissions(Page $model): Primitive { return $this->primitive((new PermissionsService($model))->get()); } }