header('X-Import-Key') ?? $request->query('api_key'); if (!$apiKey || $provided !== $apiKey) { return response()->json(['error' => 'Unauthorized'], 401); } return $next($request); } }