ergebnis/http-method
A small Composer package providing named constants for HTTP request methods, so you can reference GET, POST, PUT, PATCH, DELETE, and others by name instead of magic strings in your PHP code.
Illuminate\Http\Request and Guzzle/Symfony already ship GET/POST-style constants, so the default answer is usually "neither."PURGE and BAN for Varnish/Squid invalidation, PROPFIND/MKCOL/LOCK for WebDAV, REPORT-style CalDAV flows — this package prevents magic strings from being scattered across cache-busting jobs, reverse-proxy integration code, and outbound client calls.'PURGE' literals in the purge job.Adopt when all of the following hold:
PURGE, BAN) — not just a hypothetical future need.curl wrapper) has no constants of its own, so the alternative is literal strings.Look elsewhere or skip when:
Illuminate\Http\Request::METHOD_*-style usage, Symfony's Request::METHOD_* (bundled via symfony/http-foundation), or Fig\Http\Message\RequestMethodInterface from psr/http-message utilities already covers standard verbs. Adding a second source of truth creates conflicting constants.GET, POST, PUT, PATCH, DELETE are already available everywhere; you'd be paying a dependency for zero informational gain.tryFrom/from semantics. Laravel 9+ backed enums let you define enum HttpMethod: string with GET = 'GET' and add isSafe(), isIdempotent(), allowsBody() in-house in about 30 lines — often the better product decision because you own the extension points.To executives (30 seconds): "A tiny, free, MIT-licensed library that gives us named constants for HTTP verbs, including the unusual ones like cache-purge and WebDAV calls. Cost is effectively zero — one Composer line, no runtime dependency beyond PHP itself, no network calls, no data handling. It's a code-quality nicety, not a strategic bet; I'd approve it only if we're actually shipping cache-purge or WebDAV endpoints, and otherwise we should just use what Laravel and Symfony already give us."
To engineering (2 minutes): "ergebnis/http-method is constants-only: a Method interface for RFC 7231/5789 verbs, a Method\WebDav aggregate for the RFC 4918/3744/4791 family, and Method\Vendor\VarnishCache / SquidCache for PURGE and BAN. No logic, no autoloading surprises. The one thing to check before merging the PR is PHP-version support — the maintainer drops EOL PHP minors in minor releases, so if we're pinned to an older runtime, Composer will fight us. It also duplicates Symfony\Component\HttpFoundation\Request::METHOD_* and the FIG RequestMethodInterface, so pick it only for the verbs those don't cover, and don't mix sources in the same file. If we'd rather not take the dependency, the fallback is a backed enum in our own app/Support namespace — same readability, one more class to maintain, plus we can attach isIdempotent() and validation helpers."
Recommendation to state plainly: low-priority, conditional adoption. Approve as a one-line addition if and only if cache-purge or WebDAV work is already on the roadmap; otherwise defer and revisit at that point.
How can I help you explore Laravel packages today?