Skip to content

Commit

Permalink
trying to figure out how to prefix the namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
fredbradley committed Jul 27, 2021
1 parent 90f2ea9 commit a23e956
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Facade.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ public function useInstitution(Institution $institution): self
public function useController(string $controller): self
{
if (class_exists(self::CONTROLLER_NAMESPACE.$controller)) {
$this->controller = new self::CONTROLLER_NAMESPACE.$controller($this->institution);
$controllerClass = self::CONTROLLER_NAMESPACE.$controller;

$this->controller = new $controllerClass($this->institution);
return $this;
}
throw new \Exception("Could not find Controller: ".self::CONTROLLER_NAMESPACE.$controller);
Expand Down

0 comments on commit a23e956

Please sign in to comment.