Now displaying user's emails on user page

This commit is contained in:
Julian Prieber 2022-07-12 16:10:49 +02:00
parent 5dbd3351e9
commit 49981c8c6c
2 changed files with 6 additions and 4 deletions

View File

@ -40,19 +40,19 @@ class AdminController extends Controller
switch($usersType){
case 'all':
$data['users'] = User::select('id', 'name', 'littlelink_name', 'role', 'block', 'email_verified_at')->get();
$data['users'] = User::select('id', 'name', 'email', 'littlelink_name', 'role', 'block', 'email_verified_at')->get();
return view('panel/users', $data);
break;
case 'user':
$data['users'] = User::where('role', 'user')->select('id', 'name', 'littlelink_name', 'role', 'block', 'email_verified_at')->get();
$data['users'] = User::where('role', 'email', 'user')->select('id', 'name', 'littlelink_name', 'role', 'block', 'email_verified_at')->get();
return view('panel/users', $data);
break;
case 'vip':
$data['users'] = User::where('role', 'vip')->select('id', 'name', 'littlelink_name', 'role', 'block', 'email_verified_at')->get();
$data['users'] = User::where('role', 'email', 'vip')->select('id', 'name', 'littlelink_name', 'role', 'block', 'email_verified_at')->get();
return view('panel/users', $data);
break;
case 'admin':
$data['users'] = User::where('role', 'admin')->select('id', 'name', 'littlelink_name', 'role', 'block', 'email_verified_at')->get();
$data['users'] = User::where('role', 'email', 'admin')->select('id', 'name', 'littlelink_name', 'role', 'block', 'email_verified_at')->get();
return view('panel/users', $data);
break;
}

View File

@ -23,6 +23,7 @@
<thead>
<tr>
<th scope="col">Name</th>
<th scope="col">E-Mail</th>
<th scope="col">Page</th>
<th scope="col">Role</th>
<th scope="col">Edit</th>
@ -36,6 +37,7 @@
@foreach($users as $user)
<tr>
<td> {{ $user->name }} </td>
<td> {{ $user->email }} </td>
<td><a href="{{ url('') }}/@<?= $user->littlelink_name ?>" target="_blank" class="text-info"><i class="bi bi-box-arrow-up-right"></i>&nbsp; {{ $user->littlelink_name }} </a></td>
<td>{{ $user->role }}</td>
<td><a href="{{ route('editUser', $user->id ) }}">Edit</a></td>