updates
This commit is contained in:
@@ -7,6 +7,10 @@ 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
|
||||
@@ -23,24 +27,41 @@ 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
|
||||
class DashboardController extends Controller implements HasMiddleware
|
||||
{
|
||||
public function __construct() {
|
||||
//$this->middleware('auth');
|
||||
//$this->middleware('role:User');
|
||||
/**
|
||||
* Get the middleware that should be assigned to the controller
|
||||
*/
|
||||
public static function middleware() : array {
|
||||
return [
|
||||
new Middleware('auth');
|
||||
new Middleware('role:User');
|
||||
];
|
||||
}
|
||||
|
||||
public function displayDashboard() {
|
||||
$esiToken = new EsiToken;
|
||||
$altCount = null;
|
||||
$alts = null;
|
||||
$esiHelper = new Esi;
|
||||
$config = config('esi');
|
||||
|
||||
$esi = new Eseye();
|
||||
//dd($esi);
|
||||
$characterInfo = $esi->invoke('get', '/characters/{character_id}/', [
|
||||
'character_id' => 92471016,
|
||||
$roleEntry = UserRole::where([
|
||||
'character_id' => auth()->user()->character_id,
|
||||
]);
|
||||
dd($characterInfo);
|
||||
$role = $roleEntry->role;
|
||||
|
||||
/**
|
||||
* Alt Counts
|
||||
*/
|
||||
$altCount = UserAlt::where([
|
||||
'main_id' => auth()->user()->character_id,
|
||||
])->count();
|
||||
|
||||
|
||||
|
||||
return view('dashboard.dashboard')->with(['characterId' => $esiToken->refresh_token]);
|
||||
return view('dashboard.dashboard')->with('altCount', $altCount)
|
||||
->with('role', $role);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user