ElementsCMSCollection
A collection class for managing CMS items, providing methods for filtering, ordering, pagination, and searching.
Constructor
__construct(ElementsCMS $cms, string $path, array $options = [])
__construct(ElementsCMS $cms, string $path, array $options = [])Instance Methods
with(string ...$relations): self
with(string ...$relations): selffilter(array $criteria = []): self
filter(array $criteria = []): selffilterWith(callable $callback): self
filterWith(callable $callback): selforderBy(string $field, string $direction = 'desc'): self
orderBy(string $field, string $direction = 'desc'): selfwhereDate(string $field, string $operator, string $date): self
whereDate(string $field, string $operator, string $date): selfpaginate(int $page = 1, int $perPage = 10): array
paginate(int $page = 1, int $perPage = 10): arraygetCollection(): LaravelCollection
getCollection(): LaravelCollectionfindBySlug(string $slug): ?ElementsCMSItem
findBySlug(string $slug): ?ElementsCMSItemsearch(string $query): array
search(string $query): arrayUsage Example
Last updated
Was this helpful?

