Skip to main content

Questions tagged [collections]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
104 views

Accessing eager loaded Collections data

So I have a query to return series. At the same time I eager load the series client. {% set series = craft.entries() .section('series') .inArchive(false) .with('client') .collect() %} ...
Markus Anton's user avatar
1 vote
1 answer
397 views

How to implement Laravel's collection `filter` method inside twig?

How to implement Laravel's collection filter method inside twig? Laravel: $collection = collect([1, 2, 3, 4]); $filtered = $collection->filter(function ($value, $key) { return $value > 2; }...
user's user avatar
  • 63
4 votes
2 answers
959 views

Craft 4: using the new laravel collections and related methods (in a performant way)

I am working on a website for a radio that publishes its programs as podcasts with episodes. Each of the 30 or so programs potentially has a lot of episodes. Each entry in the episodes channel has a ...
Jérôme Coupé's user avatar