protected function scanFiles($current_directory)
    {
        $files = collect(Storage::files($current_directory));
        $files = $files->filter(function ($file) {
            $ext = File::extension($file);

            if ($this->filter === 'images') {
                return in_array($ext, $this->config->get('media.images_ext'));
            } elseif ($this->filter === 'files') {
                return in_array($ext, $this->config->get('media.files_ext'));
            }

            return true;
        });

        return $files;
    }
protected function scanFiles($current_directory)
    {
        $files = collect(Storage::files($current_directory));
        $files = $files->filter(function ($file) {
            $ext = File::extension($file);

            if ($this->filter === 'images') {
                return in_array($ext, $this->config->get('media.images_ext'));
            } elseif ($this->filter === 'files') {
                return in_array($ext, $this->config->get('media.files_ext'));
            }

            return true;
        });

        return $files;
    }
protected function scanFiles ( $ current_directory ) { $ files = collect ( Storage :: files ( $ current_directory ) ) ; $ files = $ files -> filter ( function ( $ file ) { $ ext = File :: extension ( $ file ) ; if ( $ this -> filter === 'images' ) { return in_array ( $ ext , $ this -> config -> get ( 'media.images_ext' ) ) ; } elseif ( $ this -> filter === 'files' ) { return in_array ( $ ext , $ this -> config -> get ( 'media.files_ext' ) ) ; } return true ; } ) ; return $ files ; }
Scan files of the given directory.

@param $current_directory
@return \Illuminate\Support\Collection
Scan files of the given directory .