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.
A solution is a simple PHP class that implements the Spatie\ErrorSolutions\Contracts\Solution interface.
Here's a simple example.
class MySolution implements Solution
{
public function getSolutionTitle(): string
{
return 'My custom solution';
}
public function getSolutionDescription(): string
{
return 'My custom solution description';
}
public function getDocumentationLinks(): array
{
return [
'Spatie docs' => 'https://spatie.be/docs',
];
}
}
Optionally, you can add "provided by" information to a solution by implementing the methods.
// in your solution class
public function solutionProvidedByName(): string
{
return 'Flare';
}
public function solutionProvidedByLink(): string
{
return 'https://flareapp.io';
}
How can I help you explore Laravel packages today?