protected function parseObserver($observer)
    {
        if (preg_match('([^A-Za-z0-9_/\\\\])', $observer)) {
            throw new InvalidArgumentException('Observer name contains invalid characters.');
        }

        $observer = str_replace('/', '\\', $observer);

        if (! Str::startsWith($observer, [
            $rootNamespace = $this->laravel->getNamespace(),
            '\\'
        ])) {
            $observer = $rootNamespace . $this->getComponentNamespace()
                . '\Observers\\'
                . rtrim($observer, 'Observer') . 'Observer';
        }

        return $observer;
    }