Radical Design Course by Jack McDade

From the creator of Statamic

Learn how to make your websites standout and be remembered.

This course is the most refreshing take on teaching design that I've come across.

— Mikaël Sévigny, Developer

where Modifier

Filter an array (such as a Replicator field's data) to items where a key has a specific value.

games:
-
feeling: love
title: Dominion
-
feeling: love
title: Netrunner
-
feeling: hate
title: Chutes and Ladders
<h2>I love...</h2>
{{ games | where('feeling', 'love') }}
{{ title }}<br>
{{ /games }}
Dominion
Netrunner

You can also pass an operator to the modifier, so you can do checks like "where not" and "where greater than". Under the hood, this uses the where method of Laravel Collections, so you can use any operators it supports.

<h2>I hate...</h2>
{{ games | where('feeling', '!=' 'love') }}
{{ title }}<br>
{{ /games }}
Docs feedback

Submit improvements, related content, or suggestions through Github.

Betterify this page →