/** * Handle the command. * * @param StreamRepositoryInterface $streams */ public function handle(StreamRepositoryInterface $streams) { if (!$this->folder->isForceDeleting()) { return; } $streams->delete($streams->findBySlugAndNamespace($this->folder->getSlug(), 'files')); }
/** * Handle the command. * * @param FileRepositoryInterface $files */ public function handle(FileRepositoryInterface $files) { foreach ($this->folder->getFiles() as $file) { if ($this->folder->isForceDeleting()) { $files->forceDelete($file); } else { $files->delete($file); } } }
/** * Handle the command. * * @param MountManager $manager */ public function handle(MountManager $manager) { if (!($disk = $this->folder->getDisk())) { return; } if (!$this->folder->isForceDeleting()) { return; } $manager->deleteDir($disk->getSlug() . '://' . $this->folder->getSlug()); }