asispts/http-accept
A small PHP library for parsing HTTP Accept headers. It turns Accept, Accept-Language, Accept-Encoding and Accept-Charset values into usable objects, handles quality factors and wildcards, and helps you choose the best matching media type, language or encoding for a request.
Architecture fit: asispts/http-accept is a small, framework-agnostic PHP utility for parsing HTTP Accept headers. It fits Laravel applications as a composer dependency rather than a Laravel-native package. Likely use cases are content negotiation, API version negotiation, and response-format selection in middleware or controllers. Its low coupling makes it easy to isolate behind an application-level adapter, which is the recommended pattern for a utility with a single maintainer and a young release history.
Integration feasibility: Feasible for teams already on Composer. The v1.0.0 release renames the Composer project to asispts/http-accept, which means existing consumers must update their composer.json requirement and any namespace/reference paths. The parser refactor in the same release increases the chance of behavioral changes in edge-case header parsing. Integration should be treated as a minor migration, not a drop-in patch.
Technical risk:
require entry, lockfile reference, or internal documentation pointing at the old package name must change. Without a compatibility alias or metapackage, this is a hard cut.Key questions:
q values, wildcards, and malformed headers?Stack fit: The package is a plain PHP library and should not require Laravel service providers, facades, or config publishing. It can be consumed directly or wrapped in a small application service. That makes it suitable for Laravel 9/10/11 applications that need lightweight Accept header parsing without pulling in a larger negotiation framework.
Migration path:
composer.json to asispts/http-accept at ^1.0 and regenerate the lockfile.q values, wildcards, vendor media types, and malformed input.Compatibility: Because this is a v1.0.0 after v0.1, semver permits breaking changes. Treat the upgrade as breaking until proven otherwise. Pay particular attention to the Composer rename, which will break installs even if the PHP API is unchanged. There is no indication of a Laravel version constraint, so runtime PHP compatibility should be verified against the project’s minimum PHP version.
Sequencing: Do not bundle this upgrade with unrelated dependency updates. Land the Composer rename first with no behavioral changes if possible, then adopt the refactored parser behind the adapter. If the package is used in a critical negotiation path, run it in shadow mode against production-like headers before enabling it.
Maintenance: Low ongoing maintenance if pinned and isolated. The main cost is the one-time rename and parser-validation effort. Because the package is small, the team should own a thin adapter and fixture suite so future upstream changes can be validated quickly.
Support: Support risk is moderate due to single-maintainer concentration and sparse release notes. There is no stated LTS policy. Teams should be prepared to fork or replace the parser if the project becomes inactive; the adapter boundary keeps that option cheap.
Scaling: Runtime scaling impact is negligible. Header parsing is CPU-light and stateless. The package should not introduce memory or concurrency concerns in normal Laravel request handling.
Failure modes:
Accept headers are parsed differently after the refactor.q-value ordering or wildcard matching that pass unit tests but alter API response formats.Ramp-up: Low for PHP developers. The API surface is likely one or two parser entry points. The real ramp-up is in building a fixture-based regression suite and documenting the adapter contract so the package can be swapped without touching controllers or middleware. Allocate roughly half a day for a developer familiar with the codebase to migrate and validate, plus review time for edge-case headers.
How can I help you explore Laravel packages today?