Skip to content

Create a modifier to filter replicator array (Augmented data must be accessed with raw method) #4864

Answered by LeoSeyers
LeoSeyers asked this question in Q&A
Discussion options

You must be logged in to vote

Ok, just found the problem.
Data was "augmented" and needed to be accessed via ->raw() method.

public function index($value, $params, $context)
       $entries = collect($values); 
       return $entries->filter(function ($entry) {
           return $entry['espace_pro']->raw();
       });
   }

https://statamic.dev/extending/augmentation#value

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by LeoSeyers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant