cortex = $cortex; } public function index() { // Return view effectively immediately with a loading state return view('cortex.index'); } public function getData(CortexXdrService $cortexService) { try { $summary = $cortexService->getSummary(); return response()->json($summary); } catch (\Exception $e) { return response()->json(['error' => $e->getMessage()], 500); } } }