['api/*', 'sanctum/csrf-cookie'], 'allowed_methods' => ['*'], 'allowed_origins' => array_filter(array_map('trim', explode(',', env( 'CORS_ALLOWED_ORIGINS', 'https://yxbd-fangke.ali251.langye.net,http://localhost:8020,http://127.0.0.1:8020,http://localhost:8021,http://127.0.0.1:8021' )))), // 允许本地开发端口灵活变更(如 8020/8021/8080 等) 'allowed_origins_patterns' => [ '/^http:\/\/localhost(?::\d+)?$/', '/^http:\/\/127\.0\.0\.1(?::\d+)?$/', ], 'allowed_headers' => ['*'], 'exposed_headers' => [], 'max_age' => 86400, 'supports_credentials' => true, ];