code: private function prepare(array $folders)
      {
          return collect($folders)->mapWithKeys(function ($folder) {
              $path = base_path($folder);
  
              return [
                  $folder => [
                      'chmod'    => (int) substr(sprintf('%o', fileperms($path)), -4),
                      'writable' => is_writable($path),
                  ],
              ];
          });
      }
docs: Prepare the permissions.
  
  @param  array  $folders
  
  @return \Illuminate\Support\Collection