getConnection(); // ============================== // AUTH VANGUARD (radice progetto: extra/auth.php) // ============================== require_once dirname(__DIR__, 2) . '/extra/auth.php'; // ============================== // AUTH API (TOKEN) // ============================== $user = Auth::guard('api')->user(); if (!$user) { http_response_code(401); echo json_encode(['error' => 'Unauthorized']); exit; }