original_string: public function delete_file_folder(Request $request)
      {
          $folderLocation = $request->folder_location;
          $fileFolder = $request->file_folder;
          $type = $request->type;
          $success = true;
          $error = '';
  
          if (is_array($folderLocation)) {
              $folderLocation = rtrim(implode('/', $folderLocation), '/');
          }
  
          $location = "{$this->directory}/{$folderLocation}";
          $fileFolder = "{$location}/{$fileFolder}";
  
          if ($type == 'folder') {
              if (!Storage::disk($this->filesystem)->deleteDirectory($fileFolder)) {
                  $error = __('admin.media.error_deleting_folder');
                  $success = false;
              }
          } elseif (!Storage::disk($this->filesystem)->delete($fileFolder)) {
              $error = __('admin.media.error_deleting_file');
              $success = false;
          }
  
          return compact('success', 'error');
      }
code: public function delete_file_folder(Request $request)
      {
          $folderLocation = $request->folder_location;
          $fileFolder = $request->file_folder;
          $type = $request->type;
          $success = true;
          $error = '';
  
          if (is_array($folderLocation)) {
              $folderLocation = rtrim(implode('/', $folderLocation), '/');
          }
  
          $location = "{$this->directory}/{$folderLocation}";
          $fileFolder = "{$location}/{$fileFolder}";
  
          if ($type == 'folder') {
              if (!Storage::disk($this->filesystem)->deleteDirectory($fileFolder)) {
                  $error = __('admin.media.error_deleting_folder');
                  $success = false;
              }
          } elseif (!Storage::disk($this->filesystem)->delete($fileFolder)) {
              $error = __('admin.media.error_deleting_file');
              $success = false;
          }
  
          return compact('success', 'error');
      }
code_tokens: public function delete_file_folder ( Request $ request ) { $ folderLocation = $ request -> folder_location ; $ fileFolder = $ request -> file_folder ; $ type = $ request -> type ; $ success = true ; $ error = '' ; if ( is_array ( $ folderLocation ) ) { $ folderLocation = rtrim ( implode ( '/' , $ folderLocation ) , '/' ) ; } $ location = "{$this->directory}/{$folderLocation}" ; $ fileFolder = "{$location}/{$fileFolder}" ; if ( $ type == 'folder' ) { if ( ! Storage :: disk ( $ this -> filesystem ) -> deleteDirectory ( $ fileFolder ) ) { $ error = __ ( 'admin.media.error_deleting_folder' ) ; $ success = false ; } } elseif ( ! Storage :: disk ( $ this -> filesystem ) -> delete ( $ fileFolder ) ) { $ error = __ ( 'admin.media.error_deleting_file' ) ; $ success = false ; } return compact ( 'success' , 'error' ) ; }
docstring: Delete File or Folder with 5.3
docstring_tokens: Delete File or Folder with 5 . 3