Exemplo n.º 1
0
 /**
  * Handle the command.
  *
  * @param FolderRepositoryInterface $folders
  * @return FolderInterface|bool
  */
 public function handle(FolderRepositoryInterface $folders)
 {
     $folder = $folders->findBySlug($this->directory->getPath(), $this->getFilesystemDisk());
     if ($folder && $folders->delete($folder)) {
         return $folder;
     }
     return true;
 }
Exemplo n.º 2
0
 /**
  * Fire just before saving a folder.
  *
  * @param EntryInterface|FolderInterface $entry
  */
 public function deleting(EntryInterface $entry)
 {
     $this->manager->deleteDir($entry->diskPath());
     // Delete contained files.
     foreach ($entry->getFiles() as $file) {
         $this->files->delete($file);
     }
     // Delete contained folders.
     foreach ($entry->getChildren() as $folder) {
         $this->folders->delete($folder);
     }
 }