Model Registry and Hooks
Why it exists
Hook registration and lifecycle execution are guarded so only approved models can access hook pipelines.Register models
Generate with CLI:Hook behavior
- Strict mode: unregistered models cannot access hook registration or lifecycle hooks.
- Non-strict mode: models can be lazily granted on first registration/hook execution.
- Hook execution currently covers lifecycle event pipelines (
create,update,delete) and query cache invalidation.
Migration guidance
Previous behavior
Model.on(...)andmodel.registerHook(...)were broadly available.
Current behavior
- Register via
registerModels()or generated helper first. - Keep strict mode enabled by default.
- Prefer
static modelEventson model classes.