/** * Get all module basenames. * * @return array */ protected function getAllBasenames() { $path = $this->getPath(); try { $collection = collect($this->files->directories($path)); $basenames = $collection->map(function ($item, $key) { return basename($item); }); return $basenames; } catch (\InvalidArgumentException $e) { return collect(array()); } }
/** * Remove all items from the cache. * * @return void */ public function flush() { if ($this->files->isDirectory($this->directory)) { foreach ($this->files->directories($this->directory) as $directory) { $this->files->deleteDirectory($directory); } } }