File tree Expand file tree Collapse file tree 9 files changed +27
-43
lines changed
Expand file tree Collapse file tree 9 files changed +27
-43
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace DoeAnderson \StatamicGithubWorkflowDispatch \Listeners ;
4+
5+ use DoeAnderson \StatamicGithubWorkflowDispatch \Jobs \DispatchGithubWorkflowJob ;
6+ use Illuminate \Contracts \Queue \ShouldQueue ;
7+ use Statamic \Events \BlueprintSaved ;
8+
9+ class BlueprintSavedListener implements ShouldQueue
10+ {
11+ public function handle (BlueprintSaved $ event ): void
12+ {
13+ if ($ event ->blueprint ->namespace () === 'forms ' && config ('statamic-github-workflow-dispatch.event-types.form ' )) {
14+ DispatchGithubWorkflowJob::dispatch ();
15+ }
16+ }
17+ }
Original file line number Diff line number Diff line change 88
99class CollectionSavedListener implements ShouldQueue
1010{
11- /**
12- * Handle the event.
13- *
14- * @param CollectionSaved $event
15- * @return void
16- */
1711 public function handle (CollectionSaved $ event )
1812 {
1913 if (config ('statamic-github-workflow-dispatch.event-types.collection ' )) {
Original file line number Diff line number Diff line change 88
99class EntryListener implements ShouldQueue
1010{
11- /**
12- * Handle the event.
13- *
14- * @param \Statamic\Events\EntrySaved|\Statamic\Events\EntryDeleted $event
15- * @return void
16- */
1711 public function handle (Event $ event ): void
1812 {
1913 if (config ('statamic-github-workflow-dispatch.event-types.entry ' )) {
Original file line number Diff line number Diff line change 88
99class FormListener implements ShouldQueue
1010{
11- /**
12- * Handle the event.
13- *
14- * @param \Statamic\Events\FormSaved|\Statamic\Events\FormDeleted $event
15- * @return void
16- */
1711 public function handle (Event $ event ): void
1812 {
1913 if (config ('statamic-github-workflow-dispatch.event-types.form ' )) {
Original file line number Diff line number Diff line change 88
99class GlobalSetSavedListener implements ShouldQueue
1010{
11- /**
12- * Handle the event.
13- *
14- * @param \Statamic\Events\GlobalSetSaved $event
15- * @return void
16- */
1711 public function handle (GlobalSetSaved $ event ): void
1812 {
1913 if (config ('statamic-github-workflow-dispatch.event-types.global-set ' )) {
Original file line number Diff line number Diff line change 44
55use Illuminate \Contracts \Queue \ShouldQueue ;
66use DoeAnderson \StatamicGithubWorkflowDispatch \Jobs \DispatchGithubWorkflowJob ;
7+ use Statamic \Events \Event ;
78use Statamic \Events \NavSaved ;
89
910class NavSavedListener implements ShouldQueue
1011{
11- /**
12- * Handle the event.
13- *
14- * @param \Statamic\Events\NavSaved $event
15- * @return void
16- */
17- public function handle (NavSaved $ event ): void
12+ public function handle (Event $ event ): void
1813 {
1914 if (config ('statamic-github-workflow-dispatch.event-types.nav ' )) {
2015 DispatchGithubWorkflowJob::dispatch ();
Original file line number Diff line number Diff line change 88
99class TaxonomySavedListener implements ShouldQueue
1010{
11- /**
12- * Handle the event.
13- *
14- * @param TaxonomySaved $event
15- * @return void
16- */
1711 public function handle (TaxonomySaved $ event ): void
1812 {
1913 if (config ('statamic-github-workflow-dispatch.event-types.taxonomy ' )) {
Original file line number Diff line number Diff line change 88
99class TermListener implements ShouldQueue
1010{
11- /**
12- * Handle the event.
13- *
14- * @param \Statamic\Events\TermSaved|\Statamic\Events\TermDeleted $event
15- * @return void
16- */
1711 public function handle (Event $ event ): void
1812 {
1913 if (config ('statamic-github-workflow-dispatch.event-types.term ' )) {
Original file line number Diff line number Diff line change 22
33namespace DoeAnderson \StatamicGithubWorkflowDispatch ;
44
5+ use Statamic \Events \BlueprintSaved ;
6+ use Statamic \Events \NavTreeSaved ;
57use Statamic \Facades \Utility ;
68use Statamic \Providers \AddonServiceProvider ;
79use DoeAnderson \StatamicGithubWorkflowDispatch \Http \Controllers \CP \GithubWorkflowDispatchUtilityController ;
810
911class ServiceProvider extends AddonServiceProvider
1012{
1113 protected $ listen = [
14+ \Statamic \Events \BlueprintSaved::class => [
15+ \DoeAnderson \StatamicGithubWorkflowDispatch \Listeners \BlueprintSavedListener::class,
16+ ],
1217 \Statamic \Events \CollectionSaved::class => [
1318 \DoeAnderson \StatamicGithubWorkflowDispatch \Listeners \CollectionSavedListener::class,
1419 ],
@@ -30,6 +35,9 @@ class ServiceProvider extends AddonServiceProvider
3035 \Statamic \Events \NavSaved::class => [
3136 \DoeAnderson \StatamicGithubWorkflowDispatch \Listeners \NavSavedListener::class,
3237 ],
38+ \Statamic \Events \NavTreeSaved::class => [
39+ \DoeAnderson \StatamicGithubWorkflowDispatch \Listeners \NavSavedListener::class,
40+ ],
3341 \Statamic \Events \TaxonomySaved::class => [
3442 \DoeAnderson \StatamicGithubWorkflowDispatch \Listeners \TaxonomySavedListener::class,
3543 ],
You can’t perform that action at this time.
0 commit comments