71 lines
1.8 KiB
PHP
71 lines
1.8 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Dashboard;
|
|
|
|
//Internal Library
|
|
use App\Http\Controllers\Controller;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Support\Facades\Auth;
|
|
use Illuminate\Support\Facades\DB;
|
|
use Asantibanez\LivewireCharts\LivewireCharts;
|
|
use Asantibanez\LivewireCharts\RadarChartModel;
|
|
use Asantibanez\LivewireCharts\TreeMapChartModel;
|
|
use Livewire\Component;
|
|
use Carbon\Carbon;
|
|
|
|
//Application Library
|
|
use App\Library\Esi\Esi;
|
|
use Seat\Eseye\Cache\NullCache;
|
|
use Seat\Eseye\Configuration;
|
|
use Seat\Eseye\Containers\EsiAuthentication;
|
|
use Seat\Eseye\Eseye;
|
|
use Seat\Eseye\Exceptions\RequestFailedException;
|
|
|
|
//Models
|
|
use App\Models\Esi\EsiScope;
|
|
use App\Models\Esi\EsiToken;
|
|
use App\Models\Auth\UserPermission;
|
|
use App\Models\Auth\UserRole;
|
|
use App\Models\Auth\User;
|
|
use App\Models\Auth\UserAlt;
|
|
|
|
class DashboardController extends Controller implements HasMiddleware
|
|
{
|
|
/**
|
|
* Get the middleware that should be assigned to the controller
|
|
*/
|
|
public static function middleware() : array {
|
|
return [
|
|
new Middleware('auth'),
|
|
];
|
|
}
|
|
|
|
public function displayGuest() {
|
|
return view('dashboard.guest');
|
|
}
|
|
|
|
public function displayUser() {
|
|
$altCount = null;
|
|
$alts = null;
|
|
$esiHelper = new Esi;
|
|
$config = config('esi');
|
|
|
|
$roleEntry = UserRole::where([
|
|
'character_id' => auth()->user()->character_id,
|
|
]);
|
|
$role = $roleEntry->role;
|
|
|
|
/**
|
|
* Alt Counts
|
|
*/
|
|
$altCount = UserAlt::where([
|
|
'main_id' => auth()->user()->character_id,
|
|
])->count();
|
|
|
|
|
|
|
|
return view('dashboard.dashboard')->with('altCount', $altCount)
|
|
->with('role', $role);
|
|
}
|
|
}
|