Files
33d86d4196 Support trait-named lifecycle hooks on pages and importers (#20189)
* Support trait-named lifecycle hooks on pages and importers

Lifecycle hooks such as afterCreate() and afterSave() can currently only
be defined directly on the page class. A trait that defines one of these
hooks is silently overridden as soon as the page declares its own,
which makes it impossible for reusable traits or plugins to reliably
hook into the page lifecycle.

callHook() now also invokes {hook}{TraitName}() for every trait used by
the class (recursively), mirroring how Eloquent boots model traits via
boot{TraitName}(). The class's own hook runs first, followed by each
trait hook. Applies to panel pages (BasePage) and importers (Importer).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Test and document trait lifecycle hooks

Co-authored-by: Amp <amp@ampcode.com>

---------

Co-authored-by: jim <jim@townsend-music.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Dan Harrin <git@danharrin.com>
Co-authored-by: Amp <amp@ampcode.com>
2026-09-04 10:19:44 +01:00
..
2026-03-23 08:29:46 +00:00
2026-03-23 08:29:46 +00:00
2026-03-23 08:29:46 +00:00