Added user avatars to listing

This commit is contained in:
snipe 2017-10-24 09:51:07 -07:00
parent 8d68bb7a57
commit dc805dd9b1
3 changed files with 13 additions and 1 deletions

View file

@ -43,7 +43,9 @@ class UsersController extends Controller
'users.last_login',
'users.deleted_at',
'users.department_id',
'users.activated'
'users.activated',
'users.avatar',
])->with('manager', 'groups', 'userloc', 'company', 'department','throttle','assets','licenses','accessories','consumables')
->withCount('assets','licenses','accessories','consumables');
$users = Company::scopeCompanyables($users);

View file

@ -23,6 +23,7 @@ class UsersTransformer
{
$array = [
'id' => (int) $user->id,
'avatar' => e($user->present()->gravatar),
'name' => e($user->first_name).' '.($user->last_name),
'firstname' => e($user->first_name),
'lastname' => e($user->last_name),

View file

@ -34,6 +34,15 @@ class UserPresenter extends Presenter
"title" => trans('general.id'),
"visible" => false
],
[
"field" => "avatar",
"searchable" => false,
"sortable" => false,
"switchable" => true,
"title" => 'Avatar',
"visible" => false,
"formatter" => "imageFormatter"
],
[
"field" => "company",
"searchable" => true,