Пример #1
0
 /**
  * @return \Generator
  */
 public function fetchAll()
 {
     $slugs = $this->filesystem->foldersNames('/');
     foreach ($slugs as $slug) {
         if ($this->filesystem->has($this->generateFileNameFromSlug($slug))) {
             (yield $this->fetchBySlug($slug));
         }
     }
 }
Пример #2
0
 /**
  * @param $slug
  * @return bool
  */
 public function hasImageFor($slug)
 {
     $path = $this->generateBasePath($slug);
     $filePath = $this->composeJpgFilePath($slug, $path);
     return $this->filesystem->has($filePath);
 }