Evercode1\ViewMaker\RemoveChart::removeChartRoute PHP Method

removeChartRoute() private method

private removeChartRoute ( )
    private function removeChartRoute()
    {
        $start = '// Begin ' . $this->modelName . ' Chart Route';
        $end = '// End ' . $this->modelName . ' Chart Route';
        $replaceWith = "";
        $file = base_path('app/Http/routes.php');
        //read the entire string from file
        $content = file_get_contents($file);
        // define pattern
        $stringToDelete = $this->patternMatch($start, $end, $content);
        //replace the file string
        $updatedContent = str_replace("{$stringToDelete}", "{$replaceWith}", $content);
        //writes the entire file with updated content
        file_put_contents($file, $updatedContent);
    }