info("Clearing download directory: " . env('PATH_TO_DOWNLOAD')); $directory = new Filesystem(); $files = $directory->files(env('PATH_TO_DOWNLOAD'), false); $counter = 0; foreach ($files as $file){ if ($file->getFilename() !== '.gitignore'){ $this->info("rm " . $file->getRealPath()); unlink($file->getRealPath()); $counter++; } } $this->info("Deleted " . $counter . " file(s)"); } }