Skip to content

Commit

Permalink
added sorting by display field
Browse files Browse the repository at this point in the history
  • Loading branch information
owen committed Aug 17, 2018
1 parent 29006df commit e4ec604
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Services/VueImpersonateService.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ public function getImpersonatable()
return $model::all()->filter(function ($user) {
return $user->canBeImpersonated();
})
->sortBy($displayField)
->values()
->transform(function ($user) use ($displayField) {
return [
'id' => $user->getKey(),
Expand Down

0 comments on commit e4ec604

Please sign in to comment.