$model->uuid, 'slug' => $model->slug, 'link' => $model->link, 'type' => $model->parsedType, 'name' => $model->name, 'title' => $model->title, 'h1' => $model->h1, '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 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 includePermissions(Page $model): Primitive { return $this->primitive((new PermissionsService($model))->get()); } }