protected function resolveController($class) { $controller = $this->container->make($class); if (!$controller instanceof ControllerInterface) { throw new InvalidArgumentException('Controller must be an instance of ' . ControllerInterface::class); } return $controller; }