protected function deleteMatchingFiles($wildcard, $ignored = null)
    {
        if (is_array($files = $this->files->glob($wildcard)))
        {
            foreach ($files as $path)
            {
                if ( ! is_null($ignored))
                {
                    // Spin through each of the ignored assets and if the current file path ends
                    // with any of the ignored asset paths then we'll skip this asset as it
                    // needs to be kept.
                    foreach ((array) $ignored as $ignore)
                    {
                        if (ends_with($path, $ignore)) continue 2;
                    }
                }

                $this->files->delete($path);
            }
        }
        
    }
protected function deleteMatchingFiles($wildcard, $ignored = null)
    {
        if (is_array($files = $this->files->glob($wildcard)))
        {
            foreach ($files as $path)
            {
                if ( ! is_null($ignored))
                {
                    // Spin through each of the ignored assets and if the current file path ends
                    // with any of the ignored asset paths then we'll skip this asset as it
                    // needs to be kept.
                    foreach ((array) $ignored as $ignore)
                    {
                        if (ends_with($path, $ignore)) continue 2;
                    }
                }

                $this->files->delete($path);
            }
        }
        
    }
protected function deleteMatchingFiles ( $ wildcard , $ ignored = null ) { if ( is_array ( $ files = $ this -> files -> glob ( $ wildcard ) ) ) { foreach ( $ files as $ path ) { if ( ! is_null ( $ ignored ) ) { // Spin through each of the ignored assets and if the current file path ends // with any of the ignored asset paths then we'll skip this asset as it // needs to be kept. foreach ( ( array ) $ ignored as $ ignore ) { if ( ends_with ( $ path , $ ignore ) ) continue 2 ; } } $ this -> files -> delete ( $ path ) ; } } }
Delete matching files from the wildcard glob search except the ignored file.

@param  string  $wildcard
@param  array|string  $ignored
@return void
Delete matching files from the wildcard glob search except the ignored file .