id = $model->id; $instance->name = $model->name; $instance->html = (new PageContent($model))->render(); if (!empty($model->markdown)) { $instance->markdown = $model->markdown; } $instance->tags = ZipExportTag::fromModelArray($model->tags()->get()->all()); $instance->attachments = ZipExportAttachment::fromModelArray($model->attachments()->get()->all(), $files); return $instance; } }