Skip to content

Commit

Permalink
🩹 Fix duplicate ViewServiceProvider registration (Fixes #374)
Browse files Browse the repository at this point in the history
🩹 Fix replacing default providers (Fixes #375)
  • Loading branch information
Log1x committed Jul 16, 2024
1 parent e42873b commit 3313e21
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Roots/Acorn/DefaultProviders.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class DefaultProviders extends DefaultProvidersBase
*/
protected array $disallowedProviders = [
\Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
\Illuminate\View\ViewServiceProvider::class,
];

/**
Expand All @@ -43,6 +44,10 @@ public function __construct(?array $providers = null)
{
parent::__construct($providers);

if ($providers) {
return;
}

$this->providers = Collection::make($this->providers)
->merge($this->acornProviders)
->filter(fn ($provider) => ! Str::contains($provider, $this->disallowedProviders))
Expand Down

0 comments on commit 3313e21

Please sign in to comment.