protected function replaceViewNames(&$stub, $viewDirectory, $routesPrefix, array $views = null)
    {
        foreach (($views ?: $this->views) as $view) {
            $viewName = $this->getDotNotationName($viewDirectory, $routesPrefix, $view);
            $viewTemplate = $this->getViewTemplateName($view);
            $stub = $this->strReplace($viewTemplate, $viewName, $stub);
        }

        return $this;
    }