InfyOm\Generator\Commands\Publish\LayoutPublishCommand::updateRoutes PHP Метод

updateRoutes() приватный Метод

private updateRoutes ( )
    private function updateRoutes()
    {
        $path = config('infyom.laravel_generator.path.routes', app_path('Http/routes.php'));
        $prompt = 'Existing routes.php file detected. Should we add standard routes? (y|N) :';
        if (file_exists($path) && !$this->confirmOverwrite($path, $prompt)) {
            return;
        }
        $routeContents = file_get_contents($path);
        $routesTemplate = TemplateUtil::getTemplate('routes.auth', 'laravel-generator');
        if ($this->laravelVersion == '5.1') {
            $routesTemplate = str_replace('$LOGOUT_METHOD$', 'getLogout', $routesTemplate);
        } else {
            $routesTemplate = str_replace('$LOGOUT_METHOD$', 'logout', $routesTemplate);
        }
        $routeContents .= "\n\n" . $routesTemplate;
        file_put_contents($path, $routeContents);
        $this->comment("\nRoutes added");
    }