I don't think there's such a function. But doing it manually isn't hard, and will only require one query, same as lists
function.
$list = [];
Model::select('id', 'name', 'description')->get()->map(function($item) use(&$list) {
$list[$item['id']] = $item['name'].' - '.$item['description'];
});
Another option would be using a raw query http://laravel.com/docs/4.2/queries#raw-expressions
Model::selectRaw("concat(name, ' - ', description) as name, id")->lists('id','name');
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community