wernerdweight/cors-bundle
A Symfony bundle for adding Cross-Origin Resource Sharing (CORS) support to PHP applications. It helps configure allowed origins, headers, and methods so browsers can securely call your APIs and web endpoints, with setup handled through standard Symfony bundle configuration.
HandleCors middleware and config/cors.php since v7. For Symfony tracks, it competes with nelmio/cors-bundle, the ecosystem default.Access-Control-Allow-Origin, -Methods, -Headers, -Credentials, -Max-Age, and Vary: Origin.Consider only if:
nelmio/cors-bundle.OPTIONS and response headers should be emitted — as a spec, not a runtime dependency.Look elsewhere when:
HandleCors middleware and config/cors.php. No third-party package is justified. Confirm this before any ticket is filed — the repo is a Symfony bundle.nelmio/cors-bundle; it has the adoption, docs, and release cadence this doesn't.Executive summary. CORS is a solved, commodity problem. This package is a small Symfony bundle with negligible adoption and no recent release. Recommendation: do not add it as a dependency. Our cost to own this capability is roughly a hundred lines of middleware plus a config file — cheaper than the security-review and upgrade burden of carrying a 2-star dependency.
For engineering. Treat the repo as a reference for header semantics, not a runtime dependency. If we implement in-house, ensure we: emit Vary: Origin, correctly short-circuit preflight OPTIONS, never combine wildcard origin with credentials, and make allowed origins config-driven per environment.
Platform note to flag early. The package is Symfony-specific. Our Laravel services should use the framework's built-in CORS middleware; our Symfony services should standardize on nelmio/cors-bundle. Either way, this package is out of scope.
If we want to act on the opportunity signal. The 8.8 opportunity score suggests real demand for a well-maintained, framework-agnostic CORS middleware. That's a candidate for a small internal shared package — or a low-cost OSS contribution that buys us ecosystem credibility — rather than a reason to adopt this repo.
How can I help you explore Laravel packages today?