filesystem = $filesystem; } public function handle() { $files = $this->filesystem->allFiles(public_path('lang')); array_walk($files, function (SplFileInfo $file) { if ($file->getExtension() === 'js') { $this->filesystem->delete($file->getPathname()); } }); } }