Repository navigation
0.5.0
Templates move from "renderer is usable but UI is a placeholder" to a
fully editable library. Outbound webhooks can now reference a template
by handle, so the same body lives in one place and updates propagate
to every hook that uses it.
Added
- [new] CRUD domain actions for templates:
Create,Update,Delete.
Deletedetaches outbound webhooks that reference the template by
handle so removing a library entry never silently disables a hook —
the success notice surfaces the detach count to the operator. - [new]
TemplateRepositorygainspaginate(int, ?string $search, ?string $type),
find(),findByUuid()to mirror the Outbound / Inbound / Rule
repository surfaces. - [new]
Cp\TemplateControllergrows from listing-only to full CRUD
(index/create/store/edit/update/destroy). Index supports search +
type filter; edit screen lists the registered variable resolver
namespaces inline so authors discover them without leaving the page. - [new] Vue pages.
pages/templates/Index.vue— real list with search, type filter,
and per-row edit links.pages/templates/Edit.vue(new) — sectioned form (Identity / Body)
plus a Preview panel that posts the current body to
actions.preview-templateand renders the result alongside any
validation issues.
- [new] Outbound library reuse. New nullable column
payload_template_handleonwebhook_outbounds. When set, the
HttpRequestFactoryresolves the body from the referenced template
instead of the inlinepayload_template. The body source is selected
via a new "Inline template / Library template" radio in the
Outbound edit panel. - [new] Tests.
tests/Feature/TemplateCrudTest.php— Create / Update / Delete
actions, default-handle slugification, detach behaviour on delete.tests/Feature/OutboundUsesLibraryTemplateTest.php— body source
precedence (library → inline → JSON event), missing-template fallback
to inline, template-edit propagation to subsequent renders.
- [new] i18n.
template_*notices for CRUD success messages plus a
detach-count variant for the delete flow. - [new] Routes.
routes/cp.phpadds the templates CRUD routes (the
actions.preview-templateroute already existed).
Changed
HttpRequestFactorynow takes theTemplateRepositoryas a third
constructor dependency and resolves the body in this order:
payload_template_handle→payload_template→ JSON-encoded
TriggerEvent. The library handle wins when both are set so an operator
can promote an inline body to a library entry without having to also
clear the inline field on every hook.SaveOutboundWebhookRequestallowspayload_template_handle
(nullable, must exist inwebhook_templates.handle) and skips inline-body
validation when the hook delegates to a library template — that body
is validated on the Template edit screen instead.
TODO: REVIEW
- A dangling
payload_template_handle(where the referenced template
was removed by a path that bypassesDeleteTemplateAction) silently
falls back to the inline body. This keeps deliveries alive but hides
the misconfiguration; classify as a configuration failure once the
centralised observer mentioned in PRD §54 lands. - The Edit screen's preview always uses
source_type=entry. Future
iteration: surface the four supported source types (entry / form /
user / asset) so a notification template author can preview against
the right resolver.