I'm using the Element API plugin to return data from an entry that also contains an image asset. Is there a way to combine the two so I can get the asset URL alongside the entry fields?
Attached below is an approximation of my line of thinking.
'elementType' => 'Entry',
'criteria' => ['section' => 'wax'],
'transformer' => function(EntryModel $entry) {
return [
'excerpt' => $entry->excerpt,
'heroImage' => $asset->heroImage.url // Something like this?
];