Example #1
0
 /**
  * Return a collection of elements who's ids match
  * @param array $ids
  * @return mixed
  */
 public function findByMany(array $ids)
 {
     $tagIdentifier = json_encode($ids);
     return $this->cache->tags([$this->entityName, 'global'])->remember("{$this->locale}.{$this->entityName}.findByMany.{$tagIdentifier}", $this->cacheTime, function () use($ids) {
         return $this->repository->findByMany($ids);
     });
 }
Example #2
0
 /**
  * Destroy a resource
  *
  * @param $model
  * @return mixed
  */
 public function destroy($model)
 {
     $this->cache->tags($this->entityName)->flush();
     return $this->repository->destroy($model);
 }