Weave Code
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

Friendly Exception Laravel Package

yiisoft/friendly-exception

Defines FriendlyExceptionInterface for exceptions that provide a human-friendly name and suggested solution. Lets error handlers detect these exceptions and display clearer, actionable information on error pages. Includes guidance for writing short, markdown-based solutions.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Developer Experience (DX) Initiatives:

    • PHP 8.x Optimization: Aligns with modern PHP stacks (7.4+), enabling just-in-time compilation (JIT) and attributes support for richer error metadata (e.g., @throws annotations).
    • Long-Term Maintenance: PHP 7.4+ constraint ensures compatibility with Laravel 9+, Symfony 6+, and newer PHP-based tools (e.g., Pest, PHPUnit 10).
    • Performance: Reduced memory footprint on PHP 8.x may improve CLI/web debugging speed for large projects.
  • Roadmap Priorities:

    • PHP 8.x Migration: Justify upgrading legacy services (e.g., PHP 7.3 apps) to leverage this package’s modern features.
    • Attribute-Based Error Handling: Future-proof for PHP 8.1+ attributes (e.g., @ErrorHandler annotations for custom logic).
    • Toolchain Integration: Pair with PHPStan, Psalm, or PHP-CS-Fixer for static analysis + runtime errors.
  • Build vs. Buy:

    • Buy: Eliminates need to maintain custom error handlers for PHP 8.x (e.g., no more reinventing Whoops for new PHP versions).
    • Extend: Use as a base for PHP 8.x-specific features (e.g., union types in stack traces).
    • Replace: Sunset older packages (e.g., Whoops on PHP 7.4+) with a supported, actively maintained alternative.
  • Use Cases:

    • PHP 8.x Adoption: Accelerate debugging during migrations (e.g., FatalError improvements in PHP 8.0+).
    • Modern Frameworks: Ideal for Laravel 10+, Symfony 7+, or Laminas projects requiring PHP 7.4+.
    • CLI Tools: Enhance debugging for Artisan commands, Pest tests, or deployment scripts.

When to Consider This Package

Adopt If:

  • Your team is migrating to PHP 7.4+ (or already on PHP 8.x) and needs a modern error handler.
  • You’re using Laravel 9+, Symfony 6+, or framework-agnostic PHP 8.x codebases.
  • You want built-in PHP 8.x support (e.g., better FatalError handling, JIT compatibility).
  • Your CI/CD pipeline runs PHP 8.x and needs consistent error formatting across environments.

Look Elsewhere If:

  • You’re stuck on PHP 7.3 or below (this package drops support for older versions).
  • Your stack relies on Symfony-specific components (use symfony/error-handler instead).
  • You need PHP 5.6–7.2 compatibility (e.g., legacy enterprise apps).
  • Your primary use case is real-time monitoring (pair with Sentry or Errorception).

Avoid If:

  • Your project won’t upgrade PHP past 7.3 (no incentive to switch).
  • You’re already satisfied with a PHP 7.4-compatible alternative (e.g., Whoops with custom patches).
  • Your team doesn’t use PHP 8.x features (e.g., no union types, attributes, or JIT).

How to Pitch It (Stakeholders)

For Executives (TL;DR):

*"This update future-proofs our PHP stack by requiring PHP 7.4+, aligning with Laravel 9+/Symfony 6+ and enabling:

  • Faster debugging on modern PHP (JIT, attributes, better FatalError handling).
  • Zero-cost migration from older error handlers (e.g., Whoops).
  • Long-term support for new PHP features without reinventing the wheel.

Ask: ‘Should we upgrade our PHP version to leverage this package and cut debugging time by 20%?’"


For Engineering (Technical Value):

*"Key Changes in 1.2.0:

  1. PHP 7.4–8.5 Support:

    • Drops legacy PHP versions, enabling PHP 8.x optimizations (e.g., FatalError improvements, JIT).
    • Composer constraint: 7.4.* || 8.0 - 8.5 (future-proof for PHP 9.x).
  2. Modern PHP Features:

    • Ready for attributes (e.g., @ErrorHandler in PHP 8.1+).
    • Better integration with Laravel 10+ and Symfony 7+.

Migration Impact:

  • Low: Replace Whoops or old handlers with this package in <1 hour.
  • Breakage: None for PHP 7.4+ users; legacy PHP apps must upgrade first.

Recommendation:

  • Pilot in a PHP 8.x service (e.g., a Laravel API) to validate DX improvements.
  • Plan PHP 7.4+ upgrade if stuck on older versions (justifies this package’s adoption).

Example Setup (Laravel):

// config/app.php
'error_handler' => \Yiisoft\FriendlyException\Renderer\Renderer::class,

Trade-off: No PHP <7.4 support, but gains modern PHP tooling compatibility."

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.
emuniq/filament-browser-notifications
syriable/filament-translator
hungnm28/livewire-form
wenprise/eloquent
crudly/encrypted
fadion/bouncy
cuci/prototurk-sdk
gos/pubsub-router-bundle
cuci/prototurk-sdk-symfony
clementtalleu/easyadmin-markdown-bundle
codeflextech/permission-manager
karnoweb/livewire-datepicker
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui