$model->uuid, 'slug' => $model->slug, 'link' => $model->link, 'type' => $model->parsedType, 'name' => $model->name, 'excerpt' => $model->excerpt, 'is_published' => boolval($model->is_published), 'created_at' => $model->created_at ? $model->created_at->toIso8601String() : null, 'updated_at' => $model->updated_at ? $model->updated_at->toIso8601String() : null ]; } public function includePage(Publication $model): ?Item { return $model->page ? $this->item($model->page, new PageTransformer()) : null; } public function includePoster(Publication $model): ?Item { return $model->poster ? $this->item($model->poster, new AssetTransformer()) : null; } public function includeAuthor(Publication $model): ?Item { return $model->author ? $this->item($model->author, new UserTransformer()) : null; } public function includeSections(Publication $model): Collection { return $this->collection($model->sections, new ObjectTransformer()); } public function includeSidebars(Publication $model): Collection { return $this->collection($model->sidebars, new ObjectTransformer()); } public function includePermissions(Publication $model): Primitive { return $this->primitive((new PermissionsService($model))->get()); } }