Skip to content

Commit

Permalink
Merge pull request #489 from erikgaal/optimize-commands
Browse files Browse the repository at this point in the history
Register optimize commands
  • Loading branch information
sebastiandedeyne authored Oct 10, 2024
2 parents 20effb5 + 717b810 commit 0e9205f
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 0e9205f

Please sign in to comment.