Skip to content

Commit

Permalink
Register optimize commands
Browse files Browse the repository at this point in the history
  • Loading branch information
erikgaal committed Oct 9, 2024
1 parent b7a0422 commit 717b810
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/EventSourcingServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ public function packageBooted(): void
Event::subscribe(EventSubscriber::class);

$this->discoverEventHandlers();

if (method_exists($this, 'optimizes')) {
$this->optimizes(
optimize: 'event-sourcing:cache-event-handlers',
clear: 'event-sourcing:clear-cached-event-handlers',
key: 'laravel-event-sourcing',
);
}
}

public function packageRegistered(): void
Expand Down

0 comments on commit 717b810

Please sign in to comment.