From 42cfd36293a97f70fecbe0fa470177069a945d17 Mon Sep 17 00:00:00 2001 From: Duncan McClean Date: Mon, 15 Jul 2024 18:48:49 +0100 Subject: [PATCH 1/3] Document addition of various events --- content/collections/extending-docs/events.md | 98 ++++++++++++++++++++ 1 file changed, 98 insertions(+) diff --git a/content/collections/extending-docs/events.md b/content/collections/extending-docs/events.md index f2d74e663..d0b756394 100644 --- a/content/collections/extending-docs/events.md +++ b/content/collections/extending-docs/events.md @@ -572,6 +572,18 @@ throw ValidationException::withMessages(['You did something wrong.']); You may also just modify the submission object. You do not need to `return` anything. +### GlideCacheCleared +`Statamic\Events\GlideCacheCleared` + +Dispatched after the Glide cache has been cleared, either via the `php please glide:clear` command or via the Cache Manager utility. + +``` php +public function handle(GlideCacheCleared $event) +{ + // +} +``` + ### GlideImageGenerated `Statamic\Events\GlideImageGenerated` @@ -674,6 +686,32 @@ public function handle(GlobalVariablesBlueprintFound $event) } ``` +### ImpersonationStarted +`Statamic\Events\ImpersonationStarted` + +Dispatched whenever a user starts impersonating another user. + +``` php +public function handle(ImpersonationStarted $event) +{ + $event->impersonator; // The other who started impersonating the other. + $event->impersonated; // The user being impersonated. +} +``` + +### ImpersonationEnded +`Statamic\Events\ImpersonationEnded` + +Dispatched whenever a user finishes impersonating another user. + +``` php +public function handle(ImpersonationEnded $event) +{ + $event->impersonator; // The other who started impersonating the other. + $event->impersonated; // The user being impersonated. +} +``` + ### NavDeleting `Statamic\Events\NavDeleting` @@ -796,6 +834,54 @@ public function handle(RoleSaved $event) } ``` +## SearchIndexUpdated +`Statamic\Events\SearchIndexUpdated` + +Dispatched when a search index is updated, either via the `php please search:update` command or via the Search utility. + +``` php +public function handle(SearchIndexUpdated $event) +{ + $event->index; +} +``` + +## StacheCleared +`Statamic\Events\StacheCleared` + +Dispatched after the Stache cache has been cleared, either via the `php please stache:clear` command or via the Cache Manager utility. + +``` php +public function handle(StacheCleared $event) +{ + // +} +``` + +## StacheWarmed +`Statamic\Events\StacheWarmed` + +Dispatched after the Stache cache has been warmed, either via the `php please stache:warm` command or via the Cache Manager utility. + +``` php +public function handle(StacheWarmed $event) +{ + // +} +``` + +## StaticCacheCleared +`Statamic\Events\StaticCacheCleared` + +Dispatched after the Static Cache has been cleared, either via the `php please static:clear` command or via the Cache Manager utility. + +``` php +public function handle(StaticCacheCleared $event) +{ + // +} +``` + ### SubmissionCreated `Statamic\Events\SubmissionCreated` @@ -1033,6 +1119,18 @@ public function handle(UserGroupSaved $event) } ``` +### UserPasswordChanged +`Statamic\Events\UserPasswordChanged` + +Dispatched when the password of another user has been changed in the Control Panel. + +``` php +public function handle(UserPasswordChanged $event) +{ + $event->user; +} +``` + ### UserRegistering `Statamic\Events\UserRegistering` From 438732edf9ce2f1ecfc12b8624c008ee49e6b8b0 Mon Sep 17 00:00:00 2001 From: Duncan McClean Date: Mon, 15 Jul 2024 18:51:11 +0100 Subject: [PATCH 2/3] wip --- content/collections/extending-docs/events.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/content/collections/extending-docs/events.md b/content/collections/extending-docs/events.md index d0b756394..75d659a06 100644 --- a/content/collections/extending-docs/events.md +++ b/content/collections/extending-docs/events.md @@ -834,7 +834,7 @@ public function handle(RoleSaved $event) } ``` -## SearchIndexUpdated +### SearchIndexUpdated `Statamic\Events\SearchIndexUpdated` Dispatched when a search index is updated, either via the `php please search:update` command or via the Search utility. @@ -846,7 +846,7 @@ public function handle(SearchIndexUpdated $event) } ``` -## StacheCleared +### StacheCleared `Statamic\Events\StacheCleared` Dispatched after the Stache cache has been cleared, either via the `php please stache:clear` command or via the Cache Manager utility. @@ -858,7 +858,7 @@ public function handle(StacheCleared $event) } ``` -## StacheWarmed +### StacheWarmed `Statamic\Events\StacheWarmed` Dispatched after the Stache cache has been warmed, either via the `php please stache:warm` command or via the Cache Manager utility. @@ -870,7 +870,7 @@ public function handle(StacheWarmed $event) } ``` -## StaticCacheCleared +### StaticCacheCleared `Statamic\Events\StaticCacheCleared` Dispatched after the Static Cache has been cleared, either via the `php please static:clear` command or via the Cache Manager utility. From 6541da42639a324333f8250c7252f734f1677fde Mon Sep 17 00:00:00 2001 From: Duncan McClean Date: Tue, 16 Jul 2024 11:10:49 +0100 Subject: [PATCH 3/3] document license events --- content/collections/extending-docs/events.md | 24 ++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/content/collections/extending-docs/events.md b/content/collections/extending-docs/events.md index 75d659a06..8d32e3610 100644 --- a/content/collections/extending-docs/events.md +++ b/content/collections/extending-docs/events.md @@ -712,6 +712,30 @@ public function handle(ImpersonationEnded $event) } ``` +### LicensesRefreshed +`Statamic\Events\LicensesRefreshed` + +Dispatched when a user manually triggers a "Sync" of a site's licenses via the Licenses utility. + +``` php +public function handle(LicensesRefreshed $event) +{ + // +} +``` + +### LicenseSet +`Statamic\Events\LicenseSet` + +Dispatched after a license key has been set via the `php please license:set` command. + +``` php +public function handle(LicenseSet $event) +{ + // +} +``` + ### NavDeleting `Statamic\Events\NavDeleting`