Skip to content

Commit

Permalink
fix: Process override if the class has already been resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
ollieread committed Nov 18, 2024
1 parent da6b820 commit 2dad7d8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Concerns/HandlesServiceOverrides.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ protected function registerDeferrableOverride(string $overrideClass): static
// Register the deferred override and its service
$this->deferredOverrides[$overrideClass] = $overrideClass::service();

if ($this->app->resolved($overrideClass::service())) {
$this->processOverride($overrideClass);
}

$this->app->afterResolving($overrideClass::service(), function () use ($overrideClass) {
$this->processOverride($overrideClass);

Expand Down

0 comments on commit 2dad7d8

Please sign in to comment.