1

How can I output the rows and values of a table field using the element api plugin?

Where I have entries I do

...
$industries = [];
foreach ($entry->industries->all() as $industry) {
  $industries[] = $industry->title;                    
}
...
return [
    'industries' => $industries
];

but ->all() doesn't work in the scenario of a table.

1

A table field contains a simple array, you can serialize and unserialize it as it is. So there is no custom action required by your side. Just use it in PHP like every other textual field

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.