1. Go to this page and download the library: Download spatie/ignition library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Spatie\Ignition\Contracts\Solution;
use Spatie\Ignition\Contracts\ProvidesSolution;
class CustomException extends Exception implements ProvidesSolution
{
public function getSolution(): Solution
{
return new CustomSolution();
}
}
use Spatie\Ignition\Contracts\Solution;
class CustomSolution implements Solution
{
public function getSolutionTitle(): string
{
return 'The solution title goes here';
}
public function getSolutionDescription(): string
{
return 'This is a longer description of the solution that you want to show.';
}
public function getDocumentationLinks(): array
{
return [
'Your documentation' => 'https://your-project.com/relevant-docs-page',
];
}
}
interface HasSolutionsForThrowable
{
public function canSolve(Throwable $throwable): bool;
/** @return \Spatie\Ignition\Contracts\Solution[] */
public function getSolutions(Throwable $throwable): array;
}
use Spatie\FlareClient\Report;
use Spatie\FlareClient\FlareMiddleware\FlareMiddleware;
class MyMiddleware implements FlareMiddleware
{
public function handle(Report $report, Closure $next)
{
$report->message("{$report->getMessage()}, now modified");
return $next($report);
}
}