Skip to content

Commit

Permalink
Only bind instances if they do not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes Pichler committed Dec 4, 2023
1 parent a3278a7 commit e8ed27a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ public function __call(string $method, array $params)

protected function setupContainer(array $viewPaths, string $cachePath)
{
$this->container->singleton('files', fn () => new Filesystem);
$this->container->singleton('events', fn () => new Dispatcher);
$this->container->singleton('config', fn () => new Repository([
$this->container->bindIf('files', fn () => new Filesystem);
$this->container->bindIf('events', fn () => new Dispatcher);
$this->container->bindIf('config', fn () => new Repository([
'view.paths' => $viewPaths,
'view.compiled' => $cachePath,
]));
Expand Down

0 comments on commit e8ed27a

Please sign in to comment.