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

Http Exception Laravel Package

havvg/http-exception

havvg/http-exception provides lightweight, framework-agnostic HTTP exception classes for PHP, covering common 4xx and 5xx status codes with reason phrases. Throw typed exceptions to signal HTTP errors and map them cleanly to responses or middleware.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. The package is a thin collection of PHP exception classes that extend Symfony's HttpException hierarchy so a thrown exception maps directly to an HTTP status code. It has no service providers of consequence, no configuration, no facades, and no runtime services — it is essentially a namespace of class NotFoundException extends HttpException. From an architecture standpoint this is almost perfectly shallow, which means it fits anywhere but also adds almost nothing that Laravel doesn't already provide. Modern Laravel ships abort(), Illuminate\Http\Exceptions\HttpResponseException, and the native Symfony HttpKernel\Exception classes, so the architectural gap this package fills was closed years ago.

Integration feasibility. Technically installable via Composer, but feasibility is not the same as viability. The package is at 2 stars with 0 dependents and a low composite score, which is a strong signal of abandonment. Any evaluation must first confirm the last commit date, the tested Laravel versions, the Symfony version constraint, and PHP compatibility — it is likely pinned to Symfony 2.x-era signatures that no longer match Symfony 5/6/7, and would likely fail on PHP 8 typed-signature changes. Integrating means testing against current runtime rather than trusting the manifest.

Technical risk. High. Three concrete risks: (1) upstream is dormant, so any break from a PHP or Symfony upgrade is yours to fix; (2) exception classes are on a hot path for error handling, so a signature mismatch can turn a handled 404 into an unhandled fatal; (3) the package introduces a second, parallel way of doing what the framework already does, which fragments exception handling and confuses the framework's exception renderer. The bus-factor is effectively one, and the community footprint is negligible.

Key questions. Which Laravel and PHP versions are in scope? Does the team need exception behavior that abort() and HttpResponseException cannot express — and if so, is a custom internal base exception class a better answer than a third-party dependency? Has the package been audited for Symfony HttpException constructor compatibility on the target stack? Is there any existing code already throwing these classes that must be preserved?

Integration Approach

Stack fit. Poor. In a modern Laravel stack the correct answer is native primitives: abort(404), throw new NotFoundHttpException(), or a project-owned App\Exceptions\ base class that centralizes rendering via render() or the ExceptionHandler. Adopting a 2-star package for this is an anti-pattern that adds supply-chain surface area for zero functional gain.

Migration path. If already in use, migrate away rather than adopt. Replace throw new BadRequestException(...) with abort(400, ...) (or the equivalent Symfony exception), remove the Composer requirement, and delete the package. This is a mechanical, low-risk refactor that can be done file-by-file and verified by existing HTTP test assertions. If adoption is nonetheless mandated, vendor it under a pinned version, wrap every class in a project-owned alias, and file a removal ticket at the same time.

Compatibility. Requires an explicit audit: Composer version constraints versus the installed PHP, Laravel, and Symfony versions; autoload namespace collisions with Symfony's exception classes (both historically used overlapping names); and whether class names shadow or are shadowed by framework classes. On Laravel 5.5+ package auto-discovery and beyond, verify no provider is required — this package historically has none.

Sequencing. (1) Confirm current stack versions and last-upstream-commit; (2) run a spike throwing each class under the target PHP/Laravel to see which break; (3) if breakage is significant — highly likely — abandon and standardize on native exceptions; (4) if adopted, pin, wrap, add integration tests around HTTP status mapping, and schedule removal.

Operational Impact

Maintenance. Effectively zero upstream maintenance, which is the dominant operational fact. There is no roadmap, no issue triage, no security disclosure process. Treating it as a dependency means accepting a permanent internal maintenance burden for code the team could write in an afternoon.

Support. No meaningful community support: no active maintainers, no documented discussion channels, no Stack Overflow footprint. Escalation paths are limited to reading the source. Onboarding new engineers to a non-standard exception layer that duplicates framework behavior adds friction with no compensating benefit.

Scaling. Runtime cost is negligible — these are plain classes thrown on error paths. The scaling concern is organizational, not compute: every additional custom exception hierarchy multiplies the surface area new engineers must learn, and it decouples error semantics from the framework's conventional error rendering.

Failure modes. Primary modes: fatal on PHP/Symfony signature drift, silent status-code mismatches if constructors change, unhandled exceptions if the status code is not mapped by the renderer, and class-name collisions during Composer resolution. Each failure surfaces only at error time, which is the worst time to discover it — making it a latent reliability hazard.

Ramp-up. Trivial technically (an engineer understands it in minutes) but negative in aggregate, because it teaches a non-idiomatic pattern that must later be unlearned. The realistic ramp is "learn abort() and the framework's exception renderer" — which is a better investment than learning this package.

Recommendation. Do not adopt. Standardize on Laravel's native HTTP exception handling and, if the team wants a shared vocabulary, maintain a small internal App\Exceptions base class that renders through the framework's existing handler.

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