# `MishkaCmsCore.Runtime.Resources.Changes.PublishLayoutDraft`
[🔗](https://github.com/mishka-group/mishka_cms_core/blob/v0.0.1/lib/mishka_cms_core/runtime/resources/__changes/publish_layout_draft.ex#L5)

After a `:publish` / `:master_publish` of a `MishkaCmsCore.Runtime.LayoutDraft`, writes the draft's
fields to the live `MishkaCmsCore.Runtime.Layout` — creating the layout when the draft has no
`source_layout_id`, otherwise updating the existing layout.

The write is scoped to the draft's site (`tenant: draft.site_id`, `authorize?: false`) — which is
`nil` for a global layout draft (master-managed) — so it behaves identically for master and tenant
publishes and triggers the normal Layout compile pipeline. It runs in an `after_action`, so a
Layout write failure rolls the whole publish transaction back and surfaces the error.

The Layout analogue of `MishkaCmsCore.Runtime.Resources.Changes.PublishPageDraft`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
