Hello
I am trying to append a relationship onto a DataList so I can return it as JSON, here is an example of what I mean:
I am getting my model like so:
$enteries = Entry::get();
and then to return them as JSON I do:
return json_encode($enteries->toNestedArray());
My Entry model has a has_one relation with an Image, I want to return a path to that image as part of my JSON call, what is the best way to achieve this?
Cheers