Evercode1\ViewMaker\RemoveChart::removeChartCssFromIndex PHP Method

removeChartCssFromIndex() private method

    private function removeChartCssFromIndex()
    {
        $start = '<!-- Begin Css For Chart -->';
        $end = '<!-- End Css For Chart -->';
        $replaceWith = "";
        $file = base_path('resources/views/' . $this->modelPath . '/index.blade.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);
    }