Searched around online and couldn't find an answer to this question. I want to be able to include some data from the author/user account associated with an entry.
Here is the basic working version of an individual entry, which does display the 'author' name, but no idea how to display that user's data, such as; profile photo, first name, last name, and custom member fields.
'listings/<entryId:\d+>.json' => function($entryId) {
return [
'elementType' => 'Entry',
'criteria' => ['id' => $entryId],
'first' => true,
'transformer' => function(EntryModel $entry) {
return [
(int)$entry->id,
(int)$entry->year,
$entry->manufacturer,
$entry->model,
$entry->author
];
},
];