public function scanDir($dir)
    {
        return collect(scandir($dir))->map(function ($item) use ($dir) {
            return $dir.DIRECTORY_SEPARATOR.$item;
        });
    }
public function scanDir($dir)
    {
        return collect(scandir($dir))->map(function ($item) use ($dir) {
            return $dir.DIRECTORY_SEPARATOR.$item;
        });
    }
public function scanDir ( $ dir ) { return collect ( scandir ( $ dir ) ) -> map ( function ( $ item ) use ( $ dir ) { return $ dir . DIRECTORY_SEPARATOR . $ item ; } ) ; }
Scan the directory for files.

@param string $dir

@return \Illuminate\Support\Collection
Scan the directory for files .