Skip to content Skip to footer navigation
🏰 Statamic Summit 2027 Feb 16–19 Talks, workshops, and three nights in a German castle. Get Tickets

Contains All Modifier

Search a string against multiple needles and return true if all are found, otherwise false. Comparisons are case-sensitive.

summary: "It was the best of times, it was the worst of times."
{{ if summary | contains_all('best', 'worst') }}
{{ if summary | contains_all('best', 'better') }}
@if (Statamic::modify($summary)->containsAll(['best', 'worst'])->fetch()) ... @endif
@if (Statamic::modify($summary)->containsAll(['best', 'better'])->fetch()) ... @endif
true
false