protected function parseClassname($class, $additionalNamespace = null)
    {
        if (preg_match('([^A-Za-z0-9_/\\\\])', $class)) {
            throw new InvalidArgumentException('Class name contains invalid characters.');
        }

        $class = trim(str_replace('/', '\\', $class), '\\');

        if (! Str::startsWith($class, $rootNamespace = $this->laravel->getNamespace())) {
            $namespace = $rootNamespace . ($additionalNamespace ? trim(str_replace('/', '\\', $additionalNamespace), '\\') . '\\' : '');
            $class = $namespace.$class;
        }

        return $class;
    }