Skip to content

Output from Matrix / Supertable #13

Answered by aaronbushnell
tigerchick asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks so much, @tigerchick, that means a lot! So, ultimately, XLSX and CSVs do a pretty poor job parsing multi-dimensional content. That's why you're better off getting it into some kind of comma-separated list. Here's an example of an endpoint that outputs an example set of categories or Matrix blocks into Reporter:

'transformer' => function (Entry $entry) {
    return [
        "id" => $entry->id,
        "title" => $entry->title,
        "url" => $entry->url,
        "categories" => $entry->categories->collect()
            ->pluck('title') // Category One, Category Two, ...
            ->join(', '),
        "socialNetworks" => $entry->matrixField->collect()
            ->map(fn ($block

Replies: 1 comment

Comment options

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