Open
Description
I am attempting to use the Laracasts Presenter with the lists() method like so:
$physicians = Employee::physician()->get()->lists(<formattedName>, 'id');
// <formattedName> would be the column name of the employee's name.
// Since it is stored as first and last separately, I use the Laracasts Presenter to present the concatenated full name.
I have a namespaced Employee model, and a query scope to filter the query results. My issue is, without calling the present() method, I can't access my presenter method for formatting the name. I can not find a place to insert the present() method that makes the lists() method work properly. Has anyone done this before?
My current workaround was setting a custom getter on the model to get the concatenated full name that way, but I would like to use the presenter method I already wrote if that is possible.
Metadata
Metadata
Assignees
Labels
No labels