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

Error Solutions Laravel Package

spatie/error-solutions

Collection of reusable “solutions” for common runtime errors, used by Spatie’s error tools like Ignition and Flare. Provides a shared way to suggest fixes and actionable hints when exceptions occur in Laravel and PHP apps.

View on GitHub
Deep Wiki
Context7

Getting Started

Start by installing the package via Composer: composer require spatie/error-solutions. Once installed, no additional configuration is required — it hooks into Laravel’s exception handler automatically. The first use case is resolving common development errors, such as when a required config value is missing or a view expects a variable that wasn’t passed. Run php artisan error-solutions:check to scan your app for known issues and display actionable solutions directly in the CLI. For real-time feedback, trigger solutions in development via the provided resolve() helper or in your custom exception handler using Solutions::resolve($exception).

Implementation Patterns

Use the built-in Solutions facade to programmatically suggest fixes during exception handling — for example, catch a MissingConfigValueException and offer to generate a stub .env entry. Extend the package by creating custom solution classes that implement Spatie\ErrorSolutions\Contracts\Solution and register them in config/error-solutions.php. Popular patterns include integrating solutions into report() or render() in App\Exceptions\Handler, and pairing with Laravel’s validateWithBag() or custom validation rules to auto-suggest field corrections. Leverage the SolutionsServiceProvider’s registerSolution() method to conditionally load context-aware solutions (e.g., only for local environments or specific exception types).

Gotchas and Tips

Solutions are suggestive — they don’t auto-fix code; ensure your app only calls resolve() in safe contexts (e.g., development or debug mode). The package’s solution lookup relies on matching exception types, not messages, so avoid catching generic exceptions before the solution resolver runs. If solutions don’t appear, verify APP_DEBUG=true, check that error-solutions.php config isn’t overriding the default solution path, and run config:clear after modifying config. Custom solutions should avoid heavy side effects — prefer prompting users to run commands (e.g., php artisan make:foo) or modify files via file_put_contents() rather than mutating DB directly. Lastly, all solutions are cached at runtime — clear storage/framework/cache if you update a solution class and don’t see changes.

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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport