Premier commit
This commit is contained in:
32
app/Http/Controllers/CortexXdrController.php
Normal file
32
app/Http/Controllers/CortexXdrController.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Services\CortexXdrService;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class CortexXdrController extends Controller
|
||||
{
|
||||
protected $cortex;
|
||||
|
||||
public function __construct(CortexXdrService $cortex)
|
||||
{
|
||||
$this->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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user