original_string: protected function buildPathFromArray($path, Filesystem $filesystem = null)
      {
          $pathArray = collect(explode('/', $path))->prepend('resources');
  
          if (is_null($filesystem)) {
              $filesystem = new Filesystem();
          }
  
          $base = base_path();
  
          foreach ($pathArray as $path) {
              $base = $base.'/'.$path;
  
              if (!$filesystem->exists($base)) {
                  $filesystem->makeDirectory($base);
              }
          }
      }
code: protected function buildPathFromArray($path, Filesystem $filesystem = null)
      {
          $pathArray = collect(explode('/', $path))->prepend('resources');
  
          if (is_null($filesystem)) {
              $filesystem = new Filesystem();
          }
  
          $base = base_path();
  
          foreach ($pathArray as $path) {
              $base = $base.'/'.$path;
  
              if (!$filesystem->exists($base)) {
                  $filesystem->makeDirectory($base);
              }
          }
      }
code_tokens: protected function buildPathFromArray ( $ path , Filesystem $ filesystem = null ) { $ pathArray = collect ( explode ( '/' , $ path ) ) -> prepend ( 'resources' ) ; if ( is_null ( $ filesystem ) ) { $ filesystem = new Filesystem ( ) ; } $ base = base_path ( ) ; foreach ( $ pathArray as $ path ) { $ base = $ base . '/' . $ path ; if ( ! $ filesystem -> exists ( $ base ) ) { $ filesystem -> makeDirectory ( $ base ) ; } } }
docstring: Build directory tree from array of paths.
  
  @param string          $path
  @param Filesystem|null $filesystem
docstring_tokens: Build directory tree from array of paths .