Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Cors Psr7 Laravel Package

neomerx/cors-psr7

PSR-7 CORS implementation for PHP that parses requests and generates standards-compliant Cross-Origin Resource Sharing headers. Supports preflight and actual requests, configurable origins, methods, headers, credentials, and max age for easy middleware integration.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. buy for CORS handling. CORS is a cross-cutting security behavior, not a differentiator. This package lets you buy (adopt) a spec-driven implementation of the W3C CORS algorithm instead of hand-rolling Access-Control-Allow-Origin logic, which is a recurring source of production incidents (wildcard + credentials, preflight caching, Vary: Origin omissions).
  • Whether CORS belongs in our product surface at all. If the roadmap includes public APIs, partner/browser integrations, embedded widgets, or a SPA on a separate origin, CORS becomes a first-class product requirement with explicit decisions (which origins, which methods, whether credentials are allowed). This package is the reference point for encoding those decisions correctly.
  • Standardization across a polyglot or PSR-7 service fleet. If we run multiple frameworks/services that all expose HTTP, a framework-agnostic (PSR-7) CORS layer means one mental model and one test suite, rather than N bespoke middleware implementations that drift.
  • Testability of a security-relevant behavior. Because it separates CORS policy decisions from the framework, we can unit-test allow/deny outcomes per origin and per route independently of the HTTP stack — useful for audit and compliance evidence.
  • Dependency/roadmap risk triage. With 67 stars, 0 dependents, and a last release in Nov 2022, this is a low-signal dependency. That is itself a product decision input: do not plan a roadmap around it; treat it as a reference implementation or a contained utility, not a platform bet.
  • Vendor and maintenance posture. Adopting an unmaintained package for security-relevant behavior creates an implicit obligation for us to fork/patch it. The PM decision is whether that cost is lower than the ~50 lines of middleware it replaces.

When to Consider This Package

Consider it when:

  • You are on a PSR-7 stack (or a framework that cleanly exposes PSR-7 request/response) and want the CORS algorithm handled rather than reimplemented.
  • You need W3C-spec-faithful CORS behavior — nuanced preflight handling, actual-request validation, exposed headers — and your existing middleware is a simplified subset.
  • You have multiple HTTP entry points and want one consistent CORS policy implementation shared across them.
  • You need CORS policy logic isolated and unit-testable, independent of framework middleware lifecycle.
  • You are comfortable pinning a version and owning patches — i.e., the security surface is small enough that forking is acceptable.

Look elsewhere when:

  • You are on Laravel. Laravel ships CORS handling in the framework (HandleCors middleware, config-driven via config/cors.php, which absorbed fruitcake/laravel-cors). For a Laravel-only codebase, adding this package is unnecessary indirection with a second, divergent configuration surface — a clear don't build/adopt call.
  • You need an actively maintained dependency with a security response path. Last release 2022 and no downstream dependents is a weak maintenance signal.
  • Your CORS needs are simple and static (a few allowed origins, no credentials) — native framework config or a short middleware is lower total cost of ownership.
  • You require integration conveniences (route groups, per-route overrides, Laravel-style config publishing) — this package deliberately does none of that.

How to Pitch It (Stakeholders)

One-liner: A small, spec-focused, framework-agnostic CORS library — technically solid, but a reference implementation, not a strategic dependency.

For executives: CORS misconfiguration is a real security and reliability risk (broken integrations, credential leaks), but it is a solved, low-differentiation problem. This package does not unlock new product capability; it only reduces the chance we implement CORS incorrectly. Given 67 stars, zero dependents, and no release since late 2022, we should not build roadmap or vendor commitments around it.

For engineering: On Laravel we already have first-party CORS middleware — use that, and treat this package as the spec reference for edge cases rather than a dependency. If we have a genuinely framework-agnostic PSR-7 service (or a non-Laravel edge), it is a reasonable, small-surface option provided we pin the version, wrap it behind our own policy layer, and accept fork-ownership. Otherwise: a short, well-tested middleware plus a Vary: Origin review is the better trade.

Recommendation: No adoption for Laravel-first work. Evaluate only per-service for PSR-7 contexts, with an explicit owner for patching, and a documented CORS policy (origins, credentials, exposed headers) as the actual deliverable — the library is an implementation detail.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console