mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-11 13:57:41 -08:00
Added user avatars to listing
This commit is contained in:
parent
8d68bb7a57
commit
dc805dd9b1
|
@ -43,7 +43,9 @@ class UsersController extends Controller
|
||||||
'users.last_login',
|
'users.last_login',
|
||||||
'users.deleted_at',
|
'users.deleted_at',
|
||||||
'users.department_id',
|
'users.department_id',
|
||||||
'users.activated'
|
'users.activated',
|
||||||
|
'users.avatar',
|
||||||
|
|
||||||
])->with('manager', 'groups', 'userloc', 'company', 'department','throttle','assets','licenses','accessories','consumables')
|
])->with('manager', 'groups', 'userloc', 'company', 'department','throttle','assets','licenses','accessories','consumables')
|
||||||
->withCount('assets','licenses','accessories','consumables');
|
->withCount('assets','licenses','accessories','consumables');
|
||||||
$users = Company::scopeCompanyables($users);
|
$users = Company::scopeCompanyables($users);
|
||||||
|
|
|
@ -23,6 +23,7 @@ class UsersTransformer
|
||||||
{
|
{
|
||||||
$array = [
|
$array = [
|
||||||
'id' => (int) $user->id,
|
'id' => (int) $user->id,
|
||||||
|
'avatar' => e($user->present()->gravatar),
|
||||||
'name' => e($user->first_name).' '.($user->last_name),
|
'name' => e($user->first_name).' '.($user->last_name),
|
||||||
'firstname' => e($user->first_name),
|
'firstname' => e($user->first_name),
|
||||||
'lastname' => e($user->last_name),
|
'lastname' => e($user->last_name),
|
||||||
|
|
|
@ -34,6 +34,15 @@ class UserPresenter extends Presenter
|
||||||
"title" => trans('general.id'),
|
"title" => trans('general.id'),
|
||||||
"visible" => false
|
"visible" => false
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
"field" => "avatar",
|
||||||
|
"searchable" => false,
|
||||||
|
"sortable" => false,
|
||||||
|
"switchable" => true,
|
||||||
|
"title" => 'Avatar',
|
||||||
|
"visible" => false,
|
||||||
|
"formatter" => "imageFormatter"
|
||||||
|
],
|
||||||
[
|
[
|
||||||
"field" => "company",
|
"field" => "company",
|
||||||
"searchable" => true,
|
"searchable" => true,
|
||||||
|
|
Loading…
Reference in a new issue