Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/Illuminate/Support/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,21 @@ public function driver($driver = null)
// If the given driver has not been created before, we will create the instances
// here and cache it so we can return it next time very quickly. If there is
// already a driver created by this name, we'll just return that instance.
return $this->drivers[$driver] ??= $this->createDriver($driver);
return $this->drivers[$driver] ??= $this->decorateInstance(
$this->createDriver($driver), $driver
);
}

/**
* Optionally decorate a driver instance.
*
* @param mixed $instance
* @param string $driver
* @return mixed
*/
protected function decorateInstance($instance, $driver)
{
return $instance;
}

/**
Expand Down