protected function basePath(string $path): string
    {
        // This set of preg_match would filter ftp' user is not accessing
        // exact path as path('public'), in most shared hosting ftp' user
        // would only gain access to it's /home/username directory.
        if (\preg_match('/^\/(home)\/([a-zA-Z0-9]+)\/(.*)$/', $path, $matches)) {
            $path = '/'.\ltrim($matches[3], '/');
        }

        return $path;
    }
protected function basePath(string $path): string
    {
        // This set of preg_match would filter ftp' user is not accessing
        // exact path as path('public'), in most shared hosting ftp' user
        // would only gain access to it's /home/username directory.
        if (\preg_match('/^\/(home)\/([a-zA-Z0-9]+)\/(.*)$/', $path, $matches)) {
            $path = '/'.\ltrim($matches[3], '/');
        }

        return $path;
    }
protected function basePath ( string $ path ) : string { // This set of preg_match would filter ftp' user is not accessing // exact path as path('public'), in most shared hosting ftp' user // would only gain access to it's /home/username directory. if ( \ preg_match ( '/^\/(home)\/([a-zA-Z0-9]+)\/(.*)$/' , $ path , $ matches ) ) { $ path = '/' . \ ltrim ( $ matches [ 3 ] , '/' ) ; } return $ path ; }
Get base path for FTP.

@param  string  $path

@return string
Get base path for FTP .