tailadmin update
This commit is contained in:
@@ -54,10 +54,33 @@ class DashboardController extends Controller implements HasMiddleware
|
||||
$alts = null;
|
||||
$esiHelper = new Esi;
|
||||
$config = config('esi');
|
||||
|
||||
$user = auth()->user();
|
||||
$characterId = (int)$user->character_id;
|
||||
|
||||
$scopes = EsiScope::query()
|
||||
->where('character_id', $characterId)
|
||||
->orderBy('scope')
|
||||
->get();
|
||||
|
||||
$permissions = UserPermission::query()
|
||||
->where('character_id', $characterId)
|
||||
->orderBy('permission')
|
||||
->get();
|
||||
|
||||
$roles = UserRole::query()
|
||||
->where('character_id', $characterId)
|
||||
->orderBy('rank')
|
||||
->get();
|
||||
|
||||
$alts = UserAlt::query()
|
||||
->where('main_id', $characterId)
|
||||
->orderBy('name')
|
||||
->get();
|
||||
|
||||
$roleEntry = UserRole::where([
|
||||
'character_id' => auth()->user()->character_id,
|
||||
]);
|
||||
])->first();
|
||||
$role = $roleEntry->role;
|
||||
|
||||
/**
|
||||
@@ -68,8 +91,19 @@ class DashboardController extends Controller implements HasMiddleware
|
||||
])->count();
|
||||
|
||||
|
||||
|
||||
return view('dashboard.dashboard')->with('altCount', $altCount)
|
||||
->with('role', $role);
|
||||
return view('dashboard.dashboard', [
|
||||
'title' => 'User Dashboard',
|
||||
'user' => $user,
|
||||
'scopes' => $scopes,
|
||||
'scopeCount' => $scopes->count();
|
||||
'permissions' => $permissions;
|
||||
'permissionCount' => $permissions->count();
|
||||
'roles' => $roles;
|
||||
'roleCount' => $roles->count();
|
||||
'role' => $roles->first()?->role,
|
||||
'alts' => $alts,
|
||||
'altCount' => $alts->count(),
|
||||
]);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user