collection->map(function (Answer $answer) { return [ 'id' => $answer->id, 'answer' => $answer->answer ]; }); } }