Add country flag in admin user list

This commit is contained in:
Nabeel Shahzad
2018-01-30 12:37:51 -06:00
parent cda541dad3
commit 1e33c4c9ae
2 changed files with 9 additions and 1 deletions

View File

@@ -58,6 +58,7 @@ class UserController extends BaseController
return view('admin.users.index', [
'users' => $users,
'country' => new \League\ISO3166\ISO3166(),
]);
}

View File

@@ -9,7 +9,14 @@
<tbody>
@foreach($users as $user)
<tr>
<td><a href="{!! route('admin.users.edit', [$user->id]) !!}">{!! $user->name !!}</a></td>
<td>
@if(filled($user->country))
<span class="flag-icon flag-icon-{!! $user->country !!}"
title="{!! $country->alpha2($user->country)['name'] !!}"></span>
&nbsp;
@endif
<a href="{!! route('admin.users.edit', [$user->id]) !!}">{!! $user->name !!}</a>
</td>
<td>{!! $user->email !!}</td>
<td>{!! show_date($user->created_at) !!}</td>
<td class="text-center">