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

Laravel Error Solutions Laravel Package

spatie/laravel-error-solutions

Shows helpful, actionable “solutions” directly on Laravel’s error page, explaining likely causes and fixes. Some solutions are runnable with one click (e.g., generate APP_KEY), speeding up debugging during local development.

View on GitHub
Deep Wiki
Context7

title: Via a solution provider weight: 4

If you want to add solutions to exceptions that you can't modify, you can use a solution provider. A solution provider is a class that implements the ProvidesSolution interface. It will determine if it can provide a solution for a given exception.

Here's an example:

use Spatie\ErrorSolutions\Contracts\HasSolutionsForThrowable;
use Spatie\ErrorSolutions\Contracts\Solution;
use Throwable;

class YourSolutionProvider implements HasSolutionsForThrowable
{
    public function canSolve(Throwable $throwable): bool
    {
        // return true if you can provide a solution for this exception
    }

    /**
     * [@param](https://github.com/param) \Throwable $throwable
     *
     * [@return](https://github.com/return) array<int, Solution>
     */
    public function getSolutions(Throwable $throwable): array
    {
        // return an array of solutions
    }
}

Registering your solution provider

After you've created your solution provider, you can register it in the solution_providers key of the error-solutions.php config file:

// config/error-solutions.php

return [
    'solution_providers' => [
        // other solution providers
        YourSolutionProvider::class,
    ],
];

Alternatively, you can register your solution provider at runtime. Typically, this would be done in a service provider:

// app/Providers/YourServiceProvider.php

use Spatie\ErrorSolutions\ErrorSolutionsServiceProvider;
use Spatie\ErrorSolutions\Contracts\SolutionProviderRepository;

public function register()
{
    $repository = app(SolutionProviderRepository::class);
    
    $repository->registerSolutionProviders([
        YourSolutionProvider::class,
    ]);
}
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